From c186786db74613f2db6f6776700dbcf1c15344e4 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Fri, 22 Mar 2024 16:14:08 +0100 Subject: [PATCH 01/13] chore(tx-backend) 706 temp save work --- .../openapi/traceability-foss-backend.json | 8442 +---------------- .../service/DashboardServiceImpl.java | 28 +- .../common/model/SecurityUtils.java | 1 + .../QualityNotificationFieldMapper.java | 3 +- .../service/QualityNotificationService.java | 2 +- .../rest/NotificationController.java | 146 + .../alert/model/StartQualityNotification.java | 4 + .../alert/service/AlertServiceImpl.java | 9 +- .../domain/base/NotificationRepository.java | 25 + .../base/model/QualityNotification.java | 14 + .../model/QualityNotificationMessage.java | 3 +- .../base/model/QualityNotificationType.java | 25 +- .../AbstractQualityNotificationService.java | 9 +- .../service/NotificationPublisherService.java | 24 +- .../service/InvestigationServiceImpl.java | 10 +- .../QualityNotificationRepository.java | 5 + .../service/NotificationServiceImpl.java | 50 + .../repository/AlertsRepositoryImpl.java | 11 + .../InvestigationsRepositoryImpl.java | 11 + .../model/NotificationTypeEntity.java | 35 + .../model/NotificationEntity.java | 110 + .../model/NotificationMessageEntity.java | 116 + .../JpaNotificationMessageRepository.java | 28 + .../repository/JpaNotificationRepository.java | 52 + .../NotificationRepositoryImpl.java | 237 + .../repository/NotificationSpecification.java | 42 + ...0__merge_alert_and_notification_tables.sql | 71 + .../edc/model/EdcNotificationModelTest.java | 3 +- .../PublisherInvestigationsControllerIT.java | 2 + .../QualityNotificationTypeRequest.java | 60 + .../StartQualityNotificationRequest.java | 3 + .../response/QualityNotificationResponse.java | 4 + .../QualityNotificationTypeResponse.java | 28 + 33 files changed, 1140 insertions(+), 8473 deletions(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationMessageRepository.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationSpecification.java create mode 100644 tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql create mode 100644 tx-models/src/main/java/qualitynotification/base/request/QualityNotificationTypeRequest.java create mode 100644 tx-models/src/main/java/qualitynotification/base/response/QualityNotificationTypeResponse.java diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index f0bf001f96..1e85bd123c 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1,8441 +1 @@ -{ - "openapi" : "3.0.1", - "info" : { - "title" : "Tractus-X Traceability Foss", - "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" - }, - "servers" : [ - { - "url" : "http://localhost:9998/api", - "description" : "Generated server url" - } - ], - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ], - "tags" : [ - { - "name" : "Investigations", - "description" : "Operations on Investigation Notification" - } - ], - "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" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "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" - } - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "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" - } - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : [ - { - "name" : "submodelId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "200" : { - "description" : "Returns submodel payload", - "content" : { - "application/json" : { - "schema" : { - "type" : "string" - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "post" : { - "tags" : [ - "Submodel" - ], - "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" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "type" : "string" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No Content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations" : { - "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" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/{investigationId}/update" : { - "post" : { - "tags" : [ - "Investigations" - ], - "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" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/{investigationId}/close" : { - "post" : { - "tags" : [ - "Investigations" - ], - "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" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CloseQualityNotificationRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/{investigationId}/cancel" : { - "post" : { - "tags" : [ - "Investigations" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/{investigationId}/approve" : { - "post" : { - "tags" : [ - "Investigations" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/filter" : { - "post" : { - "tags" : [ - "Investigations" - ], - "summary" : "Filter investigations defined by the request body", - "description" : "The endpoint returns investigations as paged result.", - "operationId" : "filterInvestigations", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PageableFilterRequest" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maximum" : 255, - "minimum" : 0, - "maxLength" : 255, - "type" : "integer", - "format" : "int64", - "example" : 66 - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "CREATED", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "DescriptionText" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2023-02-21T21:27:10.734950Z" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" - ], - "items" : { - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "SENDER", - "enum" : [ - "SENDER", - "RECEIVER" - ] - }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" - }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "MINOR", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "messages" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - } - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/edc/notification/contract" : { - "post" : { - "tags" : [ - "Notifications" - ], - "summary" : "Triggers EDC notification contract", - "description" : "The endpoint Triggers EDC notification contract based on notification type and method", - "operationId" : "createNotificationContract", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractRequest" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/contracts" : { - "post" : { - "tags" : [ - "Contracts" - ], - "summary" : "All contract agreements for all assets", - "description" : "This endpoint returns all contract agreements for all assets in Trace-X", - "operationId" : "contracts", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PageableFilterRequest" - } - } - }, - "required" : true - }, - "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Too many requests." - } - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Internal server error." - } - } - } - } - }, - "200" : { - "description" : "Ok.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "PageResults", - "items" : { - "$ref" : "#/components/schemas/PageResultContractResponse" - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Authorization failed." - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Forbidden." - } - } - } - } - }, - "415" : { - "description" : "Unsupported media type.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Unsupported media type." - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Not found." - } - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Bad request." - } - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/publish" : { - "post" : { - "tags" : [ - "AssetsImport", - "AssetsPublish" - ], - "summary" : "asset publish", - "description" : "This endpoint publishes assets to the Catena-X network.", - "operationId" : "publishAssets", - "parameters" : [ - { - "name" : "triggerSynchronizeAssets", - "in" : "query", - "required" : false, - "schema" : { - "type" : "boolean", - "default" : true - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/RegisterAssetRequest" - } - } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No Content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/import" : { - "post" : { - "tags" : [ - "AssetsImport" - ], - "summary" : "asset upload", - "description" : "This endpoint stores assets in the application. Those can be later published in the Catena-X network.", - "operationId" : "importJson", - "requestBody" : { - "content" : { - "multipart/form-data" : { - "schema" : { - "required" : [ - "file" - ], - "type" : "object", - "properties" : { - "file" : { - "type" : "string", - "format" : "binary" - } - } - } - } - } - }, - "responses" : { - "204" : { - "description" : "No Content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ImportResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - }, - "required" : true - }, - "responses" : { - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts" : { - "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" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/{alertId}/update" : { - "post" : { - "tags" : [ - "Alerts" - ], - "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" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" - } - } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/{alertId}/close" : { - "post" : { - "tags" : [ - "Alerts" - ], - "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" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CloseQualityNotificationRequest" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/{alertId}/cancel" : { - "post" : { - "tags" : [ - "Alerts" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/{alertId}/approve" : { - "post" : { - "tags" : [ - "Alerts" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/filter" : { - "post" : { - "tags" : [ - "Alerts" - ], - "summary" : "Filter alerts defined by the request body", - "description" : "The endpoint returns alerts as paged result.", - "operationId" : "filterAlerts", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PageableFilterRequest" - } - } - }, - "required" : true - }, - "responses" : { - "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", - "description" : "Alerts", - "items" : { - "type" : "object", - "properties" : { - "id" : { - "maximum" : 255, - "minimum" : 0, - "maxLength" : 255, - "type" : "integer", - "format" : "int64", - "example" : 66 - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "CREATED", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "DescriptionText" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2023-02-21T21:27:10.734950Z" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" - ], - "items" : { - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "SENDER", - "enum" : [ - "SENDER", - "RECEIVER" - ] - }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" - }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "MINOR", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "messages" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-planned/{assetId}" : { - "get" : { - "tags" : [ - "AssetsAsPlanned" - ], - "summary" : "Get asset by id", - "description" : "The endpoint returns an asset filtered by id .", - "operationId" : "assetById", - "parameters" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "patch" : { - "tags" : [ - "AssetsAsPlanned" - ], - "summary" : "Updates asset", - "description" : "The endpoint updates asset by provided quality type.", - "operationId" : "updateAsset", - "parameters" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateAssetRequest" - } - } - }, - "required" : true - }, - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "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" - } - } - }, - "required" : true - }, - "responses" : { - "500" : { - "description" : "Internal server error.", - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/registry/reload" : { - "get" : { - "tags" : [ - "Registry" - ], - "summary" : "Triggers reload of shell descriptors", - "description" : "The endpoint Triggers reload of shell descriptors.", - "operationId" : "reload", - "responses" : { - "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." - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/policies" : { - "get" : { - "tags" : [ - "Policies" - ], - "summary" : "Get all policies ", - "description" : "The endpoint returns all policies .", - "operationId" : "policy", - "responses" : { - "200" : { - "description" : "Returns the policies", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/{investigationId}" : { - "get" : { - "tags" : [ - "Investigations" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : -2147483648, - "type" : "array", - "description" : "Investigations", - "items" : { - "$ref" : "#/components/schemas/InvestigationResponse" - } - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/investigations/distinctFilterValues" : { - "get" : { - "tags" : [ - "Assets", - "Investigations" - ], - "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" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, - { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" - } - }, - { - "name" : "channel", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ - "SENDER", - "RECEIVER" - ] - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/dashboard" : { - "get" : { - "tags" : [ - "Dashboard" - ], - "summary" : "Returns dashboard related data", - "description" : "The endpoint can return limited data based on the user role", - "operationId" : "dashboard", - "responses" : { - "200" : { - "description" : "Returns dashboard data", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/import/report/{importJobId}" : { - "get" : { - "tags" : [ - "ImportReport", - "AssetsImport" - ], - "summary" : "report of the imported assets", - "description" : "This endpoint returns information about the imported assets to Trace-X.", - "operationId" : "importReport", - "parameters" : [ - { - "name" : "importJobId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "204" : { - "description" : "No Content." - }, - "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" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-planned" : { - "get" : { - "tags" : [ - "AssetsAsPlanned" - ], - "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" : "filter", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" - } - } - ], - "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found for Asset", - "content" : { - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : [ - { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" - } - }, - { - "name" : "size", - "in" : "query", - "required" : false, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, - { - "name" : "startWith", - "in" : "query", - "required" : false, - "schema" : { - "type" : "string" - } - }, - { - "name" : "owner", - "in" : "query", - "required" : false, - "schema" : { - "type" : "string", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-planned/*/children/{childId}" : { - "get" : { - "tags" : [ - "AssetsAsPlanned" - ], - "summary" : "Get asset by child id", - "description" : "The endpoint returns an asset filtered by child id.", - "operationId" : "assetByChildIdAndAssetId", - "parameters" : [ - { - "name" : "childId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-built" : { - "get" : { - "tags" : [ - "AssetsAsBuilt" - ], - "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" : "searchCriteriaRequestParam", - "in" : "query", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : [ - { - "name" : "fieldName", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" - } - }, - { - "name" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, - { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" - } - }, - { - "name" : "owner", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "200" : { - "description" : "Returns the assets found", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/as-built/*/children/{childId}" : { - "get" : { - "tags" : [ - "AssetsAsBuilt" - ], - "summary" : "Get asset by child id", - "description" : "The endpoint returns an asset filtered by child id.", - "operationId" : "assetByChildId", - "parameters" : [ - { - "name" : "childId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "responses" : { - "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", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - }, - "semanticModelId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "NO-246880451848384868750731" - }, - "businessPartner" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "manufacturerName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "nameAtManufacturer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "manufacturerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "owner" : { - "type" : "string", - "example" : "CUSTOMER", - "enum" : [ - "SUPPLIER", - "CUSTOMER", - "OWN", - "UNKNOWN" - ] - }, - "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" - } - }, - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - }, - "van" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "OMAYSKEITUGNVHKKX" - }, - "semanticDataModel" : { - "type" : "string", - "example" : "BATCH", - "enum" : [ - "BATCH", - "SERIALPART", - "UNKNOWN", - "PARTASPLANNED", - "JUSTINSEQUENCE", - "TOMBSTONEASBUILT", - "TOMBSTONEASPLANNED" - ] - }, - "classification" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "component" - }, - "detailAspectModels" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectModelResponse" - } - }, - "sentQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "receivedQualityAlertIdsInStatusActive" : { - "type" : "array", - "example" : 1, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - }, - "sentQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "receivedQualityInvestigationIdsInStatusActive" : { - "type" : "array", - "example" : 2, - "items" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - }, - "importState" : { - "type" : "string", - "example" : "TRANSIENT", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/{alertId}" : { - "get" : { - "tags" : [ - "Alerts" - ], - "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" - } - } - ], - "responses" : { - "200" : { - "description" : "OK.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Alerts", - "items" : { - "$ref" : "#/components/schemas/AlertResponse" - } - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/alerts/distinctFilterValues" : { - "get" : { - "tags" : [ - "Assets", - "Alerts" - ], - "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" : "size", - "in" : "query", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, - { - "name" : "startWith", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string" - } - }, - { - "name" : "channel", - "in" : "query", - "required" : true, - "schema" : { - "type" : "string", - "enum" : [ - "SENDER", - "RECEIVER" - ] - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/submodel/data" : { - "delete" : { - "tags" : [ - "Submodel" - ], - "summary" : "Delete All Submodels", - "description" : "Deletes all submodels from the system.", - "operationId" : "deleteSubmodels", - "responses" : { - "200" : { - "description" : "Ok." - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "No Content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/bpn-config/{bpn}" : { - "delete" : { - "tags" : [ - "BpnEdcMapping" - ], - "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" - } - } - ], - "responses" : { - "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" - } - } - } - }, - "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" - } - } - } - }, - "204" : { - "description" : "Deleted." - }, - "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" : "Okay" - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - } - }, - "components" : { - "schemas" : { - "BpnMappingRequest" : { - "required" : [ - "bpn", - "url" - ], - "type" : "object", - "properties" : { - "bpn" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string" - } - } - }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string", - "example" : "Access Denied" - } - } - }, - "BpnEdcMappingResponse" : { - "type" : "object", - "properties" : { - "bpn" : { - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "type" : "string", - "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" - } - } - }, - "StartQualityNotificationRequest" : { - "required" : [ - "severity" - ], - "type" : "object", - "properties" : { - "partIds" : { - "maxLength" : 100, - "minLength" : 1, - "maxItems" : 50, - "minItems" : 1, - "type" : "array", - "example" : [ - "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978" - ], - "items" : { - "maxLength" : 100, - "minLength" : 1, - "type" : "string", - "example" : "[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]" - } - }, - "description" : { - "maxLength" : 1000, - "minLength" : 15, - "type" : "string", - "example" : "The description" - }, - "targetDate" : { - "type" : "string", - "format" : "date-time", - "example" : "2099-03-11T22:44:06.333826952Z" - }, - "severity" : { - "type" : "string", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "receiverBpn" : { - "type" : "string", - "example" : "BPN00001123123AS" - }, - "asBuilt" : { - "type" : "boolean" - } - } - }, - "QualityNotificationIdResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - } - } - }, - "UpdateQualityNotificationRequest" : { - "required" : [ - "status" - ], - "type" : "object", - "properties" : { - "status" : { - "type" : "string", - "description" : "The UpdateInvestigationStatus", - "enum" : [ - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED" - ] - }, - "reason" : { - "type" : "string", - "example" : "The reason." - } - } - }, - "CloseQualityNotificationRequest" : { - "type" : "object", - "properties" : { - "reason" : { - "maxLength" : 1000, - "minLength" : 15, - "type" : "string", - "example" : "The reason." - } - } - }, - "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" - } - } - } - }, - "PageableFilterRequest" : { - "type" : "object", - "properties" : { - "pageAble" : { - "$ref" : "#/components/schemas/OwnPageable" - }, - "searchCriteria" : { - "$ref" : "#/components/schemas/SearchCriteriaRequestParam" - } - } - }, - "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, - "maxLength" : 255, - "type" : "integer", - "format" : "int64", - "example" : 66 - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "CREATED", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "DescriptionText" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2023-02-21T21:27:10.734950Z" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" - ], - "items" : { - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "SENDER", - "enum" : [ - "SENDER", - "RECEIVER" - ] - }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" - }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "MINOR", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "messages" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - }, - "QualityNotificationMessageResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "createdBy" : { - "type" : "string" - }, - "createdByName" : { - "type" : "string" - }, - "sendTo" : { - "type" : "string" - }, - "sendToName" : { - "type" : "string" - }, - "contractAgreementId" : { - "type" : "string" - }, - "notificationReferenceId" : { - "type" : "string" - }, - "targetDate" : { - "type" : "string", - "format" : "date-time" - }, - "severity" : { - "type" : "string", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "edcNotificationId" : { - "type" : "string" - }, - "created" : { - "type" : "string", - "format" : "date-time" - }, - "updated" : { - "type" : "string", - "format" : "date-time" - }, - "messageId" : { - "type" : "string" - }, - "status" : { - "type" : "string", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - } - } - }, - "QualityNotificationReasonResponse" : { - "type" : "object", - "properties" : { - "close" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "description of closing reason" - }, - "accept" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "description of accepting reason" - }, - "decline" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "description of declining reason" - } - } - }, - "CreateNotificationContractRequest" : { - "required" : [ - "notificationMethod", - "notificationType" - ], - "type" : "object", - "properties" : { - "notificationType" : { - "type" : "string", - "enum" : [ - "QUALITY_INVESTIGATION", - "QUALITY_ALERT" - ] - }, - "notificationMethod" : { - "type" : "string", - "enum" : [ - "RECEIVE", - "UPDATE", - "RESOLVE" - ] - } - } - }, - "CreateNotificationContractResponse" : { - "type" : "object", - "properties" : { - "notificationAssetId" : { - "type" : "string", - "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - }, - "accessPolicyId" : { - "type" : "string", - "example" : "123" - }, - "contractDefinitionId" : { - "type" : "string", - "example" : "456" - } - } - }, - "ContractResponse" : { - "type" : "object", - "properties" : { - "contractId" : { - "maxLength" : 255, - "type" : "string", - "example" : "66" - }, - "counterpartyAddress" : { - "maxLength" : 255, - "type" : "string", - "example" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp" - }, - "creationDate" : { - "maxLength" : 255, - "type" : "string", - "format" : "date-time", - "example" : "2023-02-21T21:27:10.73495Z" - }, - "endDate" : { - "maxLength" : 255, - "type" : "string", - "format" : "date-time", - "example" : "2023-02-21T21:27:10.73495Z" - }, - "state" : { - "maxLength" : 255, - "type" : "string", - "example" : "FINALIZED" - }, - "policy" : { - "maxLength" : 255, - "type" : "string", - "example" : "{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}" - } - } - }, - "PageResultContractResponse" : { - "type" : "object", - "properties" : { - "content" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "Content of PageResults", - "items" : { - "$ref" : "#/components/schemas/ContractResponse" - } - }, - "page" : { - "type" : "integer", - "format" : "int32", - "example" : 1 - }, - "pageCount" : { - "type" : "integer", - "format" : "int32", - "example" : 15 - }, - "pageSize" : { - "type" : "integer", - "format" : "int32", - "example" : 10 - }, - "totalItems" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - } - }, - "RegisterAssetRequest" : { - "required" : [ - "assetIds", - "policyId" - ], - "type" : "object", - "properties" : { - "policyId" : { - "type" : "string", - "example" : "a644a7cb-3de5-493b-9259-f01db315a46e" - }, - "assetIds" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } - }, - "ImportResponse" : { - "type" : "object", - "properties" : { - "jobId" : { - "type" : "string" - }, - "importStateMessage" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ImportStateMessage" - } - }, - "validationResult" : { - "$ref" : "#/components/schemas/ValidationResponse" - } - } - }, - "ImportStateMessage" : { - "type" : "object", - "properties" : { - "catenaXId" : { - "type" : "string" - }, - "persistedOrUpdated" : { - "type" : "boolean" - } - } - }, - "ValidationResponse" : { - "type" : "object", - "properties" : { - "validationErrors" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } - }, - "SyncAssetsRequest" : { - "type" : "object", - "properties" : { - "globalAssetIds" : { - "maxItems" : 100, - "minItems" : 1, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - ], - "items" : { - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]" - } - } - } - }, - "GetDetailInformationRequest" : { - "type" : "object", - "properties" : { - "assetIds" : { - "maxLength" : 50, - "minLength" : 1, - "maxItems" : 50, - "minItems" : 1, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" - ], - "items" : { - "maxLength" : 50, - "minLength" : 1, - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]" - } - } - } - }, - "DescriptionsResponse" : { - "type" : "object", - "properties" : { - "id" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0" - }, - "idShort" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "assembly-part-relationship" - } - } - }, - "DetailAspectDataAsBuiltResponse" : { - "type" : "object", - "properties" : { - "partId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "95657762-59" - }, - "customerPartId" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "01697F7-65" - }, - "nameAtCustomer" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Door front-left" - }, - "manufacturingCountry" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "DEU" - }, - "manufacturingDate" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "2022-02-04T13:48:54Z" - } - } - }, - "DetailAspectDataAsPlannedResponse" : { - "type" : "object", - "properties" : { - "validityPeriodFrom" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "2022-09-26T12:43:51.079Z" - }, - "validityPeriodTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "20232-07-13T12:00:00.000Z" - } - } - }, - "DetailAspectDataResponse" : { - "type" : "object", - "oneOf" : [ - { - "$ref" : "#/components/schemas/DetailAspectDataAsBuiltResponse" - }, - { - "$ref" : "#/components/schemas/DetailAspectDataAsPlannedResponse" - }, - { - "$ref" : "#/components/schemas/PartSiteInformationAsPlannedResponse" - }, - { - "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" - } - ] - }, - "DetailAspectDataTractionBatteryCodeResponse" : { - "type" : "object", - "properties" : { - "productType" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "pack" - }, - "tractionBatteryCode" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "X12MCPM27KLPCLX2M2382320" - }, - "subcomponents" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" - } - } - } - }, - "DetailAspectDataTractionBatteryCodeSubcomponentResponse" : { - "type" : "object", - "properties" : { - "productType" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "pack" - }, - "tractionBatteryCode" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "X12MCPM27KLPCLX2M2382320" - } - } - }, - "DetailAspectModelResponse" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string", - "example" : "PART_SITE_INFORMATION_AS_PLANNED", - "enum" : [ - "AS_BUILT", - "AS_PLANNED", - "TRACTION_BATTERY_CODE", - "SINGLE_LEVEL_BOM_AS_BUILT", - "SINGLE_LEVEL_USAGE_AS_BUILT", - "SINGLE_LEVEL_BOM_AS_PLANNED", - "PART_SITE_INFORMATION_AS_PLANNED" - ] - }, - "data" : { - "$ref" : "#/components/schemas/DetailAspectDataResponse" - } - } - }, - "PartSiteInformationAsPlannedResponse" : { - "type" : "object", - "properties" : { - "functionValidUntil" : { - "type" : "string", - "example" : "2025-02-08T04:30:48.000Z" - }, - "function" : { - "type" : "string", - "example" : "production" - }, - "functionValidFrom" : { - "type" : "string", - "example" : "2023-10-13T14:30:45+01:00" - }, - "catenaXSiteId" : { - "type" : "string", - "example" : "urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003" - } - } - }, - "AlertResponse" : { - "type" : "object", - "properties" : { - "id" : { - "maximum" : 255, - "minimum" : 0, - "maxLength" : 255, - "type" : "integer", - "format" : "int64", - "example" : 66 - }, - "status" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "CREATED", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "description" : { - "maxLength" : 1000, - "minLength" : 0, - "type" : "string", - "example" : "DescriptionText" - }, - "createdBy" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "createdByName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "createdDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2023-02-21T21:27:10.734950Z" - }, - "assetIds" : { - "maxItems" : 1000, - "minItems" : 0, - "type" : "array", - "example" : [ - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", - "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" - ], - "items" : { - "type" : "string", - "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" - } - }, - "channel" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "SENDER", - "enum" : [ - "SENDER", - "RECEIVER" - ] - }, - "reason" : { - "$ref" : "#/components/schemas/QualityNotificationReasonResponse" - }, - "sendTo" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "BPNL00000003AYRE" - }, - "sendToName" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "Tier C" - }, - "severity" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "MINOR", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "targetDate" : { - "maxLength" : 50, - "minLength" : 0, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "messages" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - }, - "UpdateAssetRequest" : { - "required" : [ - "qualityType" - ], - "type" : "object", - "properties" : { - "qualityType" : { - "type" : "string", - "example" : "Ok", - "enum" : [ - "Ok", - "Minor", - "Major", - "Critical", - "LifeThreatening" - ] - } - } - }, - "ConstraintResponse" : { - "type" : "object", - "properties" : { - "leftOperand" : { - "type" : "string", - "example" : "PURPOSE" - }, - "operatorTypeResponse" : { - "type" : "string", - "enum" : [ - "EQ", - "NEQ", - "LT", - "GT", - "IN", - "LTEQ", - "GTEQ", - "ISA", - "HASPART", - "ISPARTOF", - "ISONEOF", - "ISALLOF", - "ISNONEOF" - ] - }, - "rightOperand" : { - "type" : "string", - "example" : "ID Trace 3.1" - } - } - }, - "ConstraintsResponse" : { - "type" : "object", - "properties" : { - "and" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ConstraintResponse" - } - }, - "or" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ConstraintResponse" - } - } - } - }, - "PermissionResponse" : { - "type" : "object", - "properties" : { - "action" : { - "type" : "string", - "example" : "USE", - "enum" : [ - "ACCESS", - "USE" - ] - }, - "constraints" : { - "$ref" : "#/components/schemas/ConstraintsResponse" - } - } - }, - "PolicyResponse" : { - "type" : "object", - "properties" : { - "policyId" : { - "type" : "string", - "example" : "5a00bb50-0253-405f-b9f1-1a3150b9d51d" - }, - "createdOn" : { - "type" : "string", - "format" : "date-time" - }, - "validUntil" : { - "type" : "string", - "format" : "date-time" - }, - "permissions" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PermissionResponse" - } - } - } - }, - "DashboardResponse" : { - "type" : "object", - "properties" : { - "asBuiltCustomerParts" : { - "type" : "integer", - "format" : "int64", - "example" : 5 - }, - "asPlannedCustomerParts" : { - "type" : "integer", - "format" : "int64", - "example" : 10 - }, - "asBuiltSupplierParts" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "asPlannedSupplierParts" : { - "type" : "integer", - "format" : "int64", - "example" : 3 - }, - "asBuiltOwnParts" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "asPlannedOwnParts" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "myPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "myPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "supplierPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "customerPartsWithOpenAlerts" : { - "type" : "integer", - "format" : "int64", - "example" : 1 - }, - "supplierPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "customerPartsWithOpenInvestigations" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "receivedActiveAlerts" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "receivedActiveInvestigations" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "sentActiveAlerts" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - }, - "sentActiveInvestigations" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - } - }, - "ImportJobResponse" : { - "type" : "object", - "properties" : { - "importJobStatus" : { - "type" : "string", - "enum" : [ - "INITIALIZING", - "RUNNING", - "ERROR", - "COMPLETED" - ] - }, - "importId" : { - "type" : "string", - "example" : "456a952e-05eb-40dc-a6f2-9c2cb9c1387f" - }, - "startedOn" : { - "maxLength" : 50, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "completedOn" : { - "maxLength" : 50, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - } - } - }, - "ImportReportResponse" : { - "type" : "object", - "properties" : { - "importJob" : { - "$ref" : "#/components/schemas/ImportJobResponse" - }, - "importedAsset" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ImportedAssetResponse" - } - } - } - }, - "ImportedAssetResponse" : { - "type" : "object", - "properties" : { - "importState" : { - "type" : "string", - "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "catenaxId" : { - "type" : "string", - "example" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}" - }, - "importedOn" : { - "maxLength" : 50, - "type" : "string", - "example" : "2099-02-21T21:27:10.734950Z" - }, - "importMessage" : { - "type" : "string", - "example" : "Asset created successfully in transient state." - } - } - } - }, - "securitySchemes" : { - "oAuth2" : { - "type" : "oauth2", - "flows" : { - "clientCredentials" : { - "tokenUrl" : "https://example.com/api/oauth/token", - "scopes" : { - "profile email" : "" - } - } - } - } - } - } -} +{"openapi":"3.0.1","info":{"title":"Tractus-X Traceability Foss","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"},"servers":[{"url":"http://localhost:9998/api","description":"Generated server url"}],"security":[{"oAuth2":["profile email"]}],"tags":[{"name":"Investigations","description":"Operations on Investigation Notification"}],"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":{"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"}}}},"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"}}}},"200":{"description":"Returns the paged result found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"submodelId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns submodel payload","content":{"application/json":{"schema":{"type":"string"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"post":{"tags":["Submodel"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"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"}}}},"204":{"description":"No Content."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications":{"post":{"tags":["Notifications"],"operationId":"alertAssets","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}}}},"/notifications/{notificationId}/update":{"post":{"tags":["Notifications"],"operationId":"updateAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/close":{"post":{"tags":["Notifications"],"operationId":"closeAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/cancel":{"post":{"tags":["Notifications"],"operationId":"cancelAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/approve":{"post":{"tags":["Notifications"],"operationId":"approveAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/filter":{"post":{"tags":["Notifications"],"operationId":"getAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultAlertResponse"}}}}}}}},"/investigations":{"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"}}},"required":true},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/update":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/close":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/cancel":{"post":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/approve":{"post":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/filter":{"post":{"tags":["Investigations"],"summary":"Filter investigations defined by the request body","description":"The endpoint returns investigations as paged result.","operationId":"filterInvestigations","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"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"}}}},"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,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/edc/notification/contract":{"post":{"tags":["Notifications"],"summary":"Triggers EDC notification contract","description":"The endpoint Triggers EDC notification contract based on notification type and method","operationId":"createNotificationContract","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractRequest"}}},"required":true},"responses":{"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/contracts":{"post":{"tags":["Contracts"],"summary":"All contract agreements for all assets","description":"This endpoint returns all contract agreements for all assets in Trace-X","operationId":"contracts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Authorization failed."}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Unsupported media type."}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Forbidden."}}}}},"200":{"description":"Ok.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultContractResponse"}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Too many requests."}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Internal server error."}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Bad request."}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Not found."}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/publish":{"post":{"tags":["AssetsImport","AssetsPublish"],"summary":"asset publish","description":"This endpoint publishes assets to the Catena-X network.","operationId":"publishAssets","parameters":[{"name":"triggerSynchronizeAssets","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAssetRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import":{"post":{"tags":["AssetsImport"],"summary":"asset upload","description":"This endpoint stores assets in the application. Those can be later published in the Catena-X network.","operationId":"importJson","requestBody":{"content":{"multipart/form-data":{"schema":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts":{"post":{"tags":["Alerts"],"summary":"Start alert by part ids","description":"The endpoint starts alert based on part ids provided.","operationId":"alertAssets_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/update":{"post":{"tags":["Alerts"],"summary":"Update alert by id","description":"The endpoint updates alert by their id.","operationId":"updateAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/close":{"post":{"tags":["Alerts"],"summary":"Close alert by id","description":"The endpoint closes alert by id.","operationId":"closeAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/cancel":{"post":{"tags":["Alerts"],"summary":"Cancels alert by id","description":"The endpoint cancels alert by id.","operationId":"cancelAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/approve":{"post":{"tags":["Alerts"],"summary":"Approves alert by id","description":"The endpoint approves alert by id.","operationId":"approveAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/filter":{"post":{"tags":["Alerts"],"summary":"Filter alerts defined by the request body","description":"The endpoint returns alerts as paged result.","operationId":"filterAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"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"}}}},"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","description":"Alerts","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/{assetId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by id","description":"The endpoint returns an asset filtered by id .","operationId":"assetById","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"patch":{"tags":["AssetsAsPlanned"],"summary":"Updates asset","description":"The endpoint updates asset by provided quality type.","operationId":"updateAsset","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetRequest"}}},"required":true},"responses":{"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the updated asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/registry/reload":{"get":{"tags":["Registry"],"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/policies":{"get":{"tags":["Policies"],"summary":"Get all policies ","description":"The endpoint returns all policies .","operationId":"policy","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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications/{notificationId}":{"get":{"tags":["Notifications"],"operationId":"getAlert","parameters":[{"name":"notificationId","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"}}}}}}}},"/notifications/distinctFilterValues":{"get":{"tags":["Notifications"],"operationId":"distinctFilterValues","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/investigations/{investigationId}":{"get":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/distinctFilterValues":{"get":{"tags":["Assets","Investigations"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/dashboard":{"get":{"tags":["Dashboard"],"summary":"Returns dashboard related data","description":"The endpoint can return limited data based on the user role","operationId":"dashboard","responses":{"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"}}}},"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"}}}},"200":{"description":"Returns dashboard data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import/report/{importJobId}":{"get":{"tags":["ImportReport","AssetsImport"],"summary":"report of the imported assets","description":"This endpoint returns information about the imported assets to Trace-X.","operationId":"importReport","parameters":[{"name":"importJobId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReportResponse"}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned":{"get":{"tags":["AssetsAsPlanned"],"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":"filter","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/distinctFilterValues":{"get":{"tags":["Assets","AssetsAsPlanned"],"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":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":false,"schema":{"type":"string"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/*/children/{childId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildIdAndAssetId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built":{"get":{"tags":["AssetsAsBuilt"],"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":"searchCriteriaRequestParam","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/distinctFilterValues":{"get":{"tags":["AssetsAsBuilt","Assets"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"owner","in":"query","required":true,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":{"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/*/children/{childId}":{"get":{"tags":["AssetsAsBuilt"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}":{"get":{"tags":["Alerts"],"summary":"Gets Alert by id","description":"The endpoint returns alert by id.","operationId":"getAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/distinctFilterValues":{"get":{"tags":["Assets","Alerts"],"summary":"getDistinctFilterValues","description":"The endpoint returns a distinct filter values for given fieldName.","operationId":"distinctFilterValues_4","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/submodel/data":{"delete":{"tags":["Submodel"],"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"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"}}}},"204":{"description":"No Content."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/bpn-config/{bpn}":{"delete":{"tags":["BpnEdcMapping"],"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"}}],"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"}}}},"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"}}}},"204":{"description":"Deleted."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}}},"components":{"schemas":{"BpnMappingRequest":{"required":["bpn","url"],"type":"object","properties":{"bpn":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"url":{"maxLength":255,"minLength":0,"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"maxLength":1000,"minLength":0,"pattern":"^.*$","type":"string","example":"Access Denied"}}},"BpnEdcMappingResponse":{"type":"object","properties":{"bpn":{"type":"string","example":"BPNL00000003CSGV"},"url":{"type":"string","example":"https://trace-x-test-edc.dev.demo.catena-x.net/a1"}}},"StartQualityNotificationRequest":{"required":["severity"],"type":"object","properties":{"partIds":{"maxLength":100,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"],"items":{"maxLength":100,"minLength":1,"type":"string","example":"[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]"}},"description":{"maxLength":1000,"minLength":15,"type":"string","example":"The description"},"targetDate":{"type":"string","format":"date-time","example":"2099-03-11T22:44:06.333826952Z"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"receiverBpn":{"type":"string","example":"BPN00001123123AS"},"type":{"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"asBuilt":{"type":"boolean"}}},"QualityNotificationIdResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1}}},"UpdateQualityNotificationRequest":{"required":["status"],"type":"object","properties":{"status":{"type":"string","description":"The UpdateInvestigationStatus","enum":["ACKNOWLEDGED","ACCEPTED","DECLINED"]},"reason":{"type":"string","example":"The reason."}}},"CloseQualityNotificationRequest":{"type":"object","properties":{"reason":{"maxLength":1000,"minLength":15,"type":"string","example":"The reason."}}},"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"}}}},"PageableFilterRequest":{"type":"object","properties":{"pageAble":{"$ref":"#/components/schemas/OwnPageable"},"searchCriteria":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}},"SearchCriteriaRequestParam":{"type":"object","properties":{"filter":{"maxItems":2147483647,"type":"array","description":"Filter Criteria","example":"owner,EQUAL,OWN","items":{"type":"string"}}}},"AlertResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"PageResultAlertResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"QualityNotificationMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string"},"sendTo":{"type":"string"},"sendToName":{"type":"string"},"contractAgreementId":{"type":"string"},"notificationReferenceId":{"type":"string"},"targetDate":{"type":"string","format":"date-time"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"edcNotificationId":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"messageId":{"type":"string"},"status":{"type":"string","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"}}},"QualityNotificationReasonResponse":{"type":"object","properties":{"close":{"maxLength":1000,"minLength":0,"type":"string","example":"description of closing reason"},"accept":{"maxLength":1000,"minLength":0,"type":"string","example":"description of accepting reason"},"decline":{"maxLength":1000,"minLength":0,"type":"string","example":"description of declining reason"}}},"InvestigationResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"CreateNotificationContractRequest":{"required":["notificationMethod","notificationType"],"type":"object","properties":{"notificationType":{"type":"string","enum":["QUALITY_INVESTIGATION","QUALITY_ALERT"]},"notificationMethod":{"type":"string","enum":["RECEIVE","UPDATE","RESOLVE"]}}},"CreateNotificationContractResponse":{"type":"object","properties":{"notificationAssetId":{"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"accessPolicyId":{"type":"string","example":"123"},"contractDefinitionId":{"type":"string","example":"456"}}},"ContractResponse":{"type":"object","properties":{"contractId":{"maxLength":255,"type":"string","example":"66"},"counterpartyAddress":{"maxLength":255,"type":"string","example":"https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp"},"creationDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"endDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"state":{"maxLength":255,"type":"string","example":"FINALIZED"},"policy":{"maxLength":255,"type":"string","example":"{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}"}}},"PageResultContractResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"$ref":"#/components/schemas/ContractResponse"}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"RegisterAssetRequest":{"required":["assetIds","policyId"],"type":"object","properties":{"policyId":{"type":"string","example":"a644a7cb-3de5-493b-9259-f01db315a46e"},"assetIds":{"type":"array","items":{"type":"string"}}}},"ImportResponse":{"type":"object","properties":{"jobId":{"type":"string"},"importStateMessage":{"type":"array","items":{"$ref":"#/components/schemas/ImportStateMessage"}},"validationResult":{"$ref":"#/components/schemas/ValidationResponse"}}},"ImportStateMessage":{"type":"object","properties":{"catenaXId":{"type":"string"},"persistedOrUpdated":{"type":"boolean"}}},"ValidationResponse":{"type":"object","properties":{"validationErrors":{"type":"array","items":{"type":"string"}}}},"SyncAssetsRequest":{"type":"object","properties":{"globalAssetIds":{"maxItems":100,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"GetDetailInformationRequest":{"type":"object","properties":{"assetIds":{"maxLength":50,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"maxLength":50,"minLength":1,"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"DescriptionsResponse":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"}}},"DetailAspectDataAsBuiltResponse":{"type":"object","properties":{"partId":{"maxLength":255,"minLength":0,"type":"string","example":"95657762-59"},"customerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"01697F7-65"},"nameAtCustomer":{"maxLength":255,"minLength":0,"type":"string","example":"Door front-left"},"manufacturingCountry":{"maxLength":255,"minLength":0,"type":"string","example":"DEU"},"manufacturingDate":{"maxLength":255,"minLength":0,"type":"string","example":"2022-02-04T13:48:54Z"}}},"DetailAspectDataAsPlannedResponse":{"type":"object","properties":{"validityPeriodFrom":{"maxLength":255,"minLength":0,"type":"string","example":"2022-09-26T12:43:51.079Z"},"validityPeriodTo":{"maxLength":255,"minLength":0,"type":"string","example":"20232-07-13T12:00:00.000Z"}}},"DetailAspectDataResponse":{"type":"object","oneOf":[{"$ref":"#/components/schemas/DetailAspectDataAsBuiltResponse"},{"$ref":"#/components/schemas/DetailAspectDataAsPlannedResponse"},{"$ref":"#/components/schemas/PartSiteInformationAsPlannedResponse"},{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeResponse"}]},"DetailAspectDataTractionBatteryCodeResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"},"subcomponents":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse"}}}},"DetailAspectDataTractionBatteryCodeSubcomponentResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"}}},"DetailAspectModelResponse":{"type":"object","properties":{"type":{"type":"string","example":"PART_SITE_INFORMATION_AS_PLANNED","enum":["AS_BUILT","AS_PLANNED","TRACTION_BATTERY_CODE","SINGLE_LEVEL_BOM_AS_BUILT","SINGLE_LEVEL_USAGE_AS_BUILT","SINGLE_LEVEL_BOM_AS_PLANNED","PART_SITE_INFORMATION_AS_PLANNED"]},"data":{"$ref":"#/components/schemas/DetailAspectDataResponse"}}},"PartSiteInformationAsPlannedResponse":{"type":"object","properties":{"functionValidUntil":{"type":"string","example":"2025-02-08T04:30:48.000Z"},"function":{"type":"string","example":"production"},"functionValidFrom":{"type":"string","example":"2023-10-13T14:30:45+01:00"},"catenaXSiteId":{"type":"string","example":"urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003"}}},"UpdateAssetRequest":{"required":["qualityType"],"type":"object","properties":{"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]}}},"ConstraintResponse":{"type":"object","properties":{"leftOperand":{"type":"string","example":"PURPOSE"},"operatorTypeResponse":{"type":"string","enum":["EQ","NEQ","LT","GT","IN","LTEQ","GTEQ","ISA","HASPART","ISPARTOF","ISONEOF","ISALLOF","ISNONEOF"]},"rightOperand":{"type":"string","example":"ID Trace 3.1"}}},"ConstraintsResponse":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}},"or":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}}}},"PermissionResponse":{"type":"object","properties":{"action":{"type":"string","example":"USE","enum":["ACCESS","USE"]},"constraints":{"$ref":"#/components/schemas/ConstraintsResponse"}}},"PolicyResponse":{"type":"object","properties":{"policyId":{"type":"string","example":"5a00bb50-0253-405f-b9f1-1a3150b9d51d"},"createdOn":{"type":"string","format":"date-time"},"validUntil":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionResponse"}}}},"DashboardResponse":{"type":"object","properties":{"asBuiltCustomerParts":{"type":"integer","format":"int64","example":5},"asPlannedCustomerParts":{"type":"integer","format":"int64","example":10},"asBuiltSupplierParts":{"type":"integer","format":"int64","example":2},"asPlannedSupplierParts":{"type":"integer","format":"int64","example":3},"asBuiltOwnParts":{"type":"integer","format":"int64","example":1},"asPlannedOwnParts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"customerPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"customerPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"receivedActiveAlerts":{"type":"integer","format":"int64","example":2},"receivedActiveInvestigations":{"type":"integer","format":"int64","example":2},"sentActiveAlerts":{"type":"integer","format":"int64","example":2},"sentActiveInvestigations":{"type":"integer","format":"int64","example":2}}},"ImportJobResponse":{"type":"object","properties":{"importJobStatus":{"type":"string","enum":["INITIALIZING","RUNNING","ERROR","COMPLETED"]},"importId":{"type":"string","example":"456a952e-05eb-40dc-a6f2-9c2cb9c1387f"},"startedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"completedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"}}},"ImportReportResponse":{"type":"object","properties":{"importJob":{"$ref":"#/components/schemas/ImportJobResponse"},"importedAsset":{"type":"array","items":{"$ref":"#/components/schemas/ImportedAssetResponse"}}}},"ImportedAssetResponse":{"type":"object","properties":{"importState":{"type":"string","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"catenaxId":{"type":"string","example":"urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}"},"importedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"importMessage":{"type":"string","example":"Asset created successfully in transient state."}}}},"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://example.com/api/oauth/token","scopes":{"profile email":""}}}}}}} \ No newline at end of file diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java index 42f74e566e..b2b87332c3 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java @@ -27,9 +27,9 @@ import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.domain.dashboard.model.Dashboard; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.springframework.stereotype.Component; import java.util.List; @@ -41,8 +41,7 @@ public class DashboardServiceImpl implements DashboardService { //TODO: rework this to use Service classes instead of using the Repository directly private final AssetAsBuiltRepository assetAsBuiltRepository; private final AssetAsPlannedRepository assetAsPlannedRepository; - private final InvestigationRepository investigationsRepository; - private final AlertRepository alertRepository; + private final NotificationRepository notificationRepository; @Override public Dashboard getDashboard() { @@ -54,20 +53,20 @@ public Dashboard getDashboard() { long asPlannedOwnParts = assetAsPlannedRepository.countAssetsByOwner(Owner.OWN); - long myPartsWithSentAlerts = alertRepository.countOpenNotificationsByOwnership(List.of(Owner.OWN)); - long myPartsWithReceivedInvestigations = investigationsRepository.countOpenNotificationsByOwnership(List.of(Owner.OWN)); + long myPartsWithSentAlerts = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.OWN), QualityNotificationType.ALERT); + long myPartsWithReceivedInvestigations = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.OWN), QualityNotificationType.INVESTIGATION); - long supplierPartsWithOpenReceivedAlerts = alertRepository.countOpenNotificationsByOwnership(List.of(Owner.SUPPLIER)); - long supplierPartsWithOpenSentInvestigations = investigationsRepository.countOpenNotificationsByOwnership(List.of(Owner.SUPPLIER)); + long supplierPartsWithOpenReceivedAlerts = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.SUPPLIER), QualityNotificationType.ALERT); + long supplierPartsWithOpenSentInvestigations = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.SUPPLIER), QualityNotificationType.INVESTIGATION); - long customerPartsWithOpenReceivedAlerts = alertRepository.countOpenNotificationsByOwnership(List.of(Owner.CUSTOMER)); - long customerPartsWithOpenSentInvestigations = investigationsRepository.countOpenNotificationsByOwnership(List.of(Owner.CUSTOMER)); + long customerPartsWithOpenReceivedAlerts = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.CUSTOMER), QualityNotificationType.ALERT); + long customerPartsWithOpenSentInvestigations = notificationRepository.countOpenNotificationsByOwnershipAndNotificationType(List.of(Owner.CUSTOMER), QualityNotificationType.INVESTIGATION); - long receivedActiveInvestigations = investigationsRepository.countQualityNotificationEntitiesBySide(QualityNotificationSide.RECEIVER); - long sentActiveInvestigations = investigationsRepository.countQualityNotificationEntitiesBySide(QualityNotificationSide.SENDER); + long receivedActiveInvestigations = notificationRepository.countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide.RECEIVER, QualityNotificationType.INVESTIGATION); + long sentActiveInvestigations = notificationRepository.countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide.SENDER, QualityNotificationType.INVESTIGATION); - long receivedActiveAlerts = alertRepository.countQualityNotificationEntitiesBySide(QualityNotificationSide.RECEIVER); - long sentActiveAlerts = alertRepository.countQualityNotificationEntitiesBySide(QualityNotificationSide.SENDER); + long receivedActiveAlerts = notificationRepository.countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide.RECEIVER, QualityNotificationType.ALERT); + long sentActiveAlerts = notificationRepository.countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide.SENDER, QualityNotificationType.ALERT); return Dashboard.builder() .asBuiltCustomerParts(asBuiltCustomerParts) @@ -87,6 +86,5 @@ public Dashboard getDashboard() { .sentActiveAlerts(sentActiveAlerts) .sentActiveInvestigations(sentActiveInvestigations) .build(); - } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java index 74c0ccf767..239d96777a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/model/SecurityUtils.java @@ -62,6 +62,7 @@ public static StartQualityNotificationRequest sanitize(StartQualityNotificationR .severity(request.getSeverity()) .isAsBuilt(request.isAsBuilt()) .receiverBpn(cleanReceiverBpn) + .type(request.getType()) .partIds(cleanPartIds) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java index da4c8ba2bc..8393c39691 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java @@ -44,7 +44,8 @@ public class QualityNotificationFieldMapper extends BaseRequestFieldMapper { Map.entry("sendTo", "notifications_sendTo"), Map.entry("sendToName", "notifications_sendToName"), Map.entry("targetDate", "notifications_targetDate"), - Map.entry("assetId", "assets_id") + Map.entry("assetId", "assets_id"), + Map.entry("type", "type") ); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java index b750831392..291d403a97 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java @@ -31,7 +31,7 @@ public interface QualityNotificationService { - QualityNotificationId start(StartQualityNotification startQualityAlertDomain); + QualityNotificationId start(StartQualityNotification startQualityNotification); QualityNotification find(Long notificationId); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java new file mode 100644 index 0000000000..79e60427d8 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java @@ -0,0 +1,146 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.rest; + +import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.ws.rs.QueryParam; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; +import org.eclipse.tractusx.traceability.common.model.PageResult; +import org.eclipse.tractusx.traceability.common.request.OwnPageable; +import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; +import org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper.AlertResponseMapper; +import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; +import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.HttpStatus; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; +import qualitynotification.alert.response.AlertResponse; +import qualitynotification.base.request.CloseQualityNotificationRequest; +import qualitynotification.base.request.QualityNotificationStatusRequest; +import qualitynotification.base.request.StartQualityNotificationRequest; +import qualitynotification.base.request.UpdateQualityNotificationRequest; +import qualitynotification.base.response.QualityNotificationIdResponse; + +import java.util.List; + +import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; +import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; + +@RestController +@RequestMapping(value = "/notifications", consumes = "application/json", produces = "application/json") +@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SUPERVISOR', 'ROLE_USER')") +@Tag(name = "Notifications") +@Validated +@Slf4j +public class NotificationController { + + private final QualityNotificationService notificationService; + + private final BaseRequestFieldMapper fieldMapper; + + public NotificationController( + @Qualifier("notificationServiceImpl") QualityNotificationService notificationService, + QualityNotificationFieldMapper fieldMapper) { + this.notificationService = notificationService; + this.fieldMapper = fieldMapper; + } + + @PostMapping + @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") + @ResponseStatus(HttpStatus.CREATED) + public QualityNotificationIdResponse alertAssets(@RequestBody @Valid StartQualityNotificationRequest request) { + StartQualityNotificationRequest cleanStartQualityNotificationRequest = sanitize(request); + log.info("Received API call on /notifications" + " with params: {}", cleanStartQualityNotificationRequest); + return new QualityNotificationIdResponse(notificationService.start(from(cleanStartQualityNotificationRequest)).value()); + } + + @PostMapping("/filter") + public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { + log.info("Received API call on /notifications/filter"); + return AlertResponseMapper.fromAsPageResult( + notificationService.getNotifications( + OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), fieldMapper), + pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(fieldMapper))); + } + + @GetMapping("/{notificationId}") + public AlertResponse getAlert(@PathVariable("notificationId") Long notificationId) { + log.info("Received API call on /notifications/" + "/{}", notificationId); + return AlertResponseMapper.from(notificationService.find(notificationId)); + } + + @PostMapping("/{notificationId}/approve") + @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void approveAlert(@PathVariable("notificationId") Long notificationId) { + log.info("Received API call on /notifications/" + "/{}/approve", notificationId); + notificationService.approve(notificationId); + } + + @PostMapping("/{notificationId}/cancel") + @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void cancelAlert(@PathVariable("notificationId") Long notificationId) { + log.info("Received API call on /notifications/" + "/{}/cancel", notificationId); + notificationService.cancel(notificationId); + } + + @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") + @PostMapping("/{notificationId}/close") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void closeAlert( + @PathVariable("notificationId") @ApiParam Long notificationId, + @Valid @RequestBody CloseQualityNotificationRequest closeAlertRequest) { + CloseQualityNotificationRequest cleanCloseAlertRequest = sanitize(closeAlertRequest); + log.info("Received API call on /notifications/" + "/{}/close with params {}", notificationId, cleanCloseAlertRequest); + notificationService.update(notificationId, QualityNotificationStatus.from(QualityNotificationStatusRequest.CLOSED), cleanCloseAlertRequest.getReason()); + } + + @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") + @PostMapping("/{notificationId}/update") + @ResponseStatus(HttpStatus.NO_CONTENT) + public void updateAlert( + @PathVariable("notificationId") Long notificationId, + @Valid @RequestBody UpdateQualityNotificationRequest updateAlertRequest) { + UpdateQualityNotificationRequest cleanUpdateAlertRequest = sanitize(updateAlertRequest); + validate(cleanUpdateAlertRequest); + log.info("Received API call on /notifications/" + "/{}/update with params {}", notificationId, cleanUpdateAlertRequest); + notificationService.update(notificationId, QualityNotificationStatus.from(cleanUpdateAlertRequest.getStatus()), cleanUpdateAlertRequest.getReason()); + } + + @GetMapping("distinctFilterValues") + public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { + return notificationService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java index 776f86f7c5..ff119312a7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java @@ -23,6 +23,7 @@ import lombok.Data; import lombok.Getter; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import qualitynotification.base.request.StartQualityNotificationRequest; import java.time.Instant; @@ -41,6 +42,8 @@ public class StartQualityNotification { private QualityNotificationSeverity severity; + private QualityNotificationType type; + private boolean isAsBuilt; private String receiverBpn; @@ -52,6 +55,7 @@ public static StartQualityNotification from(StartQualityNotificationRequest star .description(startQualityNotificationRequest.getDescription()) .targetDate(startQualityNotificationRequest.getTargetDate()) .severity(QualityNotificationSeverity.from(startQualityNotificationRequest.getSeverity())) + .type(QualityNotificationType.from(startQualityNotificationRequest.getType())) .receiverBpn(startQualityNotificationRequest.getReceiverBpn()) .isAsBuilt(startQualityNotificationRequest.isAsBuilt()) .build(); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java index df2981099f..729ffec227 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java @@ -23,6 +23,7 @@ import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; @@ -33,16 +34,16 @@ public class AlertServiceImpl extends AbstractQualityNotificationService { - private final AlertRepository alertRepository; + private final NotificationRepository notificationRepository; - public AlertServiceImpl(TraceabilityProperties traceabilityProperties, AlertRepository alertRepository, NotificationPublisherService notificationPublisherService) { + public AlertServiceImpl(TraceabilityProperties traceabilityProperties, NotificationRepository alertRepository, NotificationPublisherService notificationPublisherService) { super(traceabilityProperties, notificationPublisherService); - this.alertRepository = alertRepository; + this.notificationRepository = alertRepository; } @Override protected QualityNotificationRepository getQualityNotificationRepository() { - return alertRepository; + return notificationRepository; } @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java new file mode 100644 index 0000000000..e2b5a9db6c --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java @@ -0,0 +1,25 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.domain.base; + +import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; + +public interface NotificationRepository extends QualityNotificationRepository { +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java index 748f030c98..3f47f00766 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java @@ -43,6 +43,7 @@ public class QualityNotification { private String description; private Instant createdAt; private QualityNotificationSide notificationSide; + private QualityNotificationType notificationType; @Builder.Default private List assetIds = new ArrayList<>(); private String closeReason; @@ -53,6 +54,7 @@ public class QualityNotification { private List notifications = List.of(); + // TODO cleanup afterwards public static QualityNotification startNotification(Instant createDate, BPN bpn, String description) { // rename to generic return QualityNotification.builder() .bpn(bpn) @@ -64,6 +66,18 @@ public static QualityNotification startNotification(Instant createDate, BPN bpn, .build(); } + public static QualityNotification startNotification(Instant createDate, BPN bpn, String description, QualityNotificationType notificationType) { // rename to generic + return QualityNotification.builder() + .bpn(bpn) + .notificationStatus(QualityNotificationStatus.CREATED) + .notificationSide(QualityNotificationSide.SENDER) + .notificationType(notificationType) + .description(description) + .createdAt(createDate) + .assetIds(Collections.emptyList()) + .build(); + } + public List getAssetIds() { return Collections.unmodifiableList(assetIds); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java index 147db87ef5..b317d389bc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java @@ -68,7 +68,7 @@ public void changeStatusTo(QualityNotificationStatus to) { this.notificationStatus = to; } - public static QualityNotificationMessage create(BPN applicationBpn, String receiverBpn, String description, Instant targetDate, QualityNotificationSeverity severity, Map.Entry> asset, String creator, String sendToName) { + public static QualityNotificationMessage create(BPN applicationBpn, String receiverBpn, String description, Instant targetDate, QualityNotificationSeverity severity, QualityNotificationType notificationType, Map.Entry> asset, String creator, String sendToName) { final String notificationId = UUID.randomUUID().toString(); final String messageId = UUID.randomUUID().toString(); return QualityNotificationMessage.builder() @@ -84,6 +84,7 @@ public static QualityNotificationMessage create(BPN applicationBpn, String recei .targetDate(targetDate) .severity(severity) .edcNotificationId(notificationId) + .type(notificationType) .messageId(messageId) .build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java index cbadc7c5bf..e2e695d6c7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java @@ -19,7 +19,28 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.base.model; +import qualitynotification.base.request.QualityNotificationTypeRequest; + public enum QualityNotificationType { - INVESTIGATION, - ALERT + INVESTIGATION("INVESTIGATION"), + ALERT("ALERT"); + + private final String realName; + + QualityNotificationType(String realName) { + this.realName = realName; + } + + public static QualityNotificationType fromString(String str) { + for (QualityNotificationType s : QualityNotificationType.values()) { + if (s.realName.equalsIgnoreCase(str)) { + return s; + } + } + throw new IllegalArgumentException("No enum constant " + QualityNotificationType.class.getCanonicalName() + "." + str); + } + + public static QualityNotificationType from(QualityNotificationTypeRequest qualityNotificationTypeRequest) { + return QualityNotificationType.fromString(qualityNotificationTypeRequest.getRealName()); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 894e7db3a1..9a143883e6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -60,7 +60,14 @@ public PageResult getNotifications(Pageable pageable, Searc @Override public QualityNotificationId start(StartQualityNotification startQualityNotification) { - QualityNotification notification = notificationPublisherService.startQualityNotification(startQualityNotification.getPartIds(), startQualityNotification.getDescription(), startQualityNotification.getTargetDate(), startQualityNotification.getSeverity(), startQualityNotification.getReceiverBpn(), startQualityNotification.isAsBuilt()); + QualityNotification notification = notificationPublisherService.startQualityNotification( + startQualityNotification.getPartIds(), + startQualityNotification.getDescription(), + startQualityNotification.getTargetDate(), + startQualityNotification.getSeverity(), + startQualityNotification.getType(), + startQualityNotification.getReceiverBpn(), + startQualityNotification.isAsBuilt()); QualityNotificationId createdAlertId = getQualityNotificationRepository().saveQualityNotificationEntity(notification); log.info("Start Quality Notification {}", notification); return createdAlertId; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java index 7235583a15..d879e9a011 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java @@ -33,6 +33,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.exception.QualityNotificationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; import org.springframework.stereotype.Service; @@ -67,6 +68,7 @@ public class NotificationPublisherService { * @param isAsBuilt the isAsBuilt of the investigation * @return the ID of the newly created investigation */ + // TODO remove public QualityNotification startQualityNotification(List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, String receiverBpn, boolean isAsBuilt) { BPN applicationBPN = traceabilityProperties.getBpn(); QualityNotification notification = QualityNotification.startNotification(clock.instant(), applicationBPN, description); @@ -78,7 +80,27 @@ public QualityNotification startQualityNotification(List assetIds, Strin .map(it -> { String creator = getManufacturerNameByBpn(traceabilityProperties.getBpn().value()); String sendToName = getManufacturerNameByBpn(receiverBpn); - return QualityNotificationMessage.create(applicationBPN, receiverBpn, description, targetDate, severity, it, creator, sendToName); + return QualityNotificationMessage.create(applicationBPN, receiverBpn, description, targetDate, severity,QualityNotificationType.INVESTIGATION, it, creator, sendToName); + }) + .forEach(notification::addNotification); + return notification; + } else { + throw new NotificationNotSupportedException(); + } + } + + public QualityNotification startQualityNotification(List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, QualityNotificationType type, String receiverBpn, boolean isAsBuilt) { + BPN applicationBPN = traceabilityProperties.getBpn(); + QualityNotification notification = QualityNotification.startNotification(clock.instant(), applicationBPN, description, type); + if (isAsBuilt) { + Map> assetsAsBuiltBPNMap = assetAsBuiltRepository.getAssetsById(assetIds).stream().collect(groupingBy(AssetBase::getManufacturerId)); + assetsAsBuiltBPNMap + .entrySet() + .stream() + .map(it -> { + String creator = getManufacturerNameByBpn(traceabilityProperties.getBpn().value()); + String sendToName = getManufacturerNameByBpn(receiverBpn); + return QualityNotificationMessage.create(applicationBPN, receiverBpn, description, targetDate, severity, type, it, creator, sendToName); }) .forEach(notification::addNotification); return notification; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java index 65e7c79a6b..53bf99279e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; @@ -32,16 +32,16 @@ @Service("investigationServiceImpl") public class InvestigationServiceImpl extends AbstractQualityNotificationService { - private final InvestigationRepository investigationsRepository; + private final NotificationRepository notificationRepository; - public InvestigationServiceImpl(TraceabilityProperties traceabilityProperties, InvestigationRepository investigationsRepository, NotificationPublisherService notificationPublisherService) { + public InvestigationServiceImpl(TraceabilityProperties traceabilityProperties, NotificationRepository notificationRepository, NotificationPublisherService notificationPublisherService) { super(traceabilityProperties, notificationPublisherService); - this.investigationsRepository = investigationsRepository; + this.notificationRepository = notificationRepository; } @Override protected QualityNotificationRepository getQualityNotificationRepository() { - return investigationsRepository; + return notificationRepository; } @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java index def4e04745..785dae311c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.springframework.data.domain.Pageable; import java.util.List; @@ -42,6 +43,8 @@ public interface QualityNotificationRepository { long countQualityNotificationEntitiesBySide(QualityNotificationSide investigationSide); + long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide investigationSide, QualityNotificationType notificationType); + QualityNotificationId saveQualityNotificationEntity(QualityNotification investigation); void updateQualityNotificationEntity(QualityNotification investigation); @@ -50,6 +53,8 @@ public interface QualityNotificationRepository { long countOpenNotificationsByOwnership(List owners); + long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType); + List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide owner); void updateErrorMessage(QualityNotification investigation); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java new file mode 100644 index 0000000000..ffa97a50b2 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java @@ -0,0 +1,50 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.domain.service; + +import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; +import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.springframework.stereotype.Service; + +@Service("notificationServiceImpl") +public class NotificationServiceImpl extends AbstractQualityNotificationService { + + + private final NotificationRepository notificationRepository; + + public NotificationServiceImpl(TraceabilityProperties traceabilityProperties, NotificationRepository alertRepository, NotificationPublisherService notificationPublisherService) { + super(traceabilityProperties, notificationPublisherService); + this.notificationRepository = alertRepository; + } + + @Override + protected QualityNotificationRepository getQualityNotificationRepository() { + return notificationRepository; + } + + @Override + public RuntimeException getNotFoundException(String message) { + return new AlertNotFoundException(message); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java index 4fdd8cd71f..5d63394cb3 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java @@ -38,6 +38,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; @@ -168,6 +169,11 @@ public long countOpenNotificationsByOwnership(List owners) { .toList().size(); } + @Override + public long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType) { + return 0; + } + @Override public Optional findByEdcNotificationId(String edcNotificationId) { return jpaAlertRepository.findByNotificationsEdcNotificationId(edcNotificationId) @@ -179,6 +185,11 @@ public long countQualityNotificationEntitiesBySide(QualityNotificationSide alert return jpaAlertRepository.countAllBySideEquals(NotificationSideBaseEntity.valueOf(alertSide.name())); } + @Override + public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide investigationSide, QualityNotificationType notificationType) { + return 0; + } + private void handleNotificationUpdate(AlertEntity alertEntity, QualityNotification alert) { List notificationEntities = new ArrayList<>(alertEntity.getNotifications()); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java index 1d148537ba..c372355cce 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java @@ -40,6 +40,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; @@ -87,6 +88,11 @@ public long countOpenNotificationsByOwnership(List owners) { return jpaInvestigationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)).stream().map(InvestigationEntity::getAssets).flatMap(Collection::stream).filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())).distinct().toList().size(); } + @Override + public long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType) { + return 0; + } + @Override public void updateQualityNotificationEntity(QualityNotification investigation) { InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); @@ -157,6 +163,11 @@ public long countQualityNotificationEntitiesBySide(QualityNotificationSide inves return jpaInvestigationRepository.countAllBySideEquals(NotificationSideBaseEntity.valueOf(investigationSide.name())); } + @Override + public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide investigationSide, QualityNotificationType notificationType) { + return 0; + } + private void handleNotificationUpdate(InvestigationEntity investigationEntity, QualityNotification investigation) { for (QualityNotificationMessage notification : investigation.getNotifications()) { List assetEntitiesByInvestigation = getAssetEntitiesByInvestigation(investigation); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java new file mode 100644 index 0000000000..bdd431d81e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java @@ -0,0 +1,35 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; + +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; + +public enum NotificationTypeEntity { + ALERT, + INVESTIGATION; + + public QualityNotificationType toDomain() { + return QualityNotificationType.valueOf(this.name()); + } + + public static NotificationTypeEntity from(QualityNotificationType type) { + return NotificationTypeEntity.valueOf(type.name()); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java new file mode 100644 index 0000000000..4b91945aa6 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java @@ -0,0 +1,110 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.SuperBuilder; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +import org.eclipse.tractusx.traceability.common.model.BPN; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; + +import java.util.List; + +import static org.apache.commons.collections4.ListUtils.emptyIfNull; + +@NoArgsConstructor +@Getter +@Setter +@Entity +@SuperBuilder +@Table(name = "notification") +public class NotificationEntity extends NotificationBaseEntity { + + + @Enumerated(EnumType.STRING) + private NotificationTypeEntity type; + + @ManyToMany(cascade = CascadeType.ALL) + @JoinTable( + name = "assets_as_built_notifications", + joinColumns = @JoinColumn(name = "notification_id"), + inverseJoinColumns = @JoinColumn(name = "asset_id") + ) + private List assets; + + @OneToMany(mappedBy = "notification") + private List notificationMessages; + + public static QualityNotification toDomain(NotificationEntity notificationEntity) { + List messages = emptyIfNull(notificationEntity.getNotificationMessages()).stream() + .map(NotificationMessageEntity::toDomain) + .toList(); + + List assetIds = notificationEntity.getAssets().stream() + .map(AssetAsBuiltEntity::getId) + .toList(); + return QualityNotification.builder() + .notificationId(new QualityNotificationId(notificationEntity.getId())) + .bpn(BPN.of(notificationEntity.getBpn())) + .notificationStatus(QualityNotificationStatus.fromStringValue(notificationEntity.getStatus().name())) + .notificationSide(QualityNotificationSide.valueOf(notificationEntity.getSide().name())) + .closeReason(notificationEntity.getCloseReason()) + .acceptReason(notificationEntity.getAcceptReason()) + .declineReason(notificationEntity.getDeclineReason()) + .createdAt(notificationEntity.getCreatedDate()) + .description(notificationEntity.getDescription()) + .notificationType(QualityNotificationType.valueOf(notificationEntity.getType().name())) + .assetIds(assetIds) + .notifications(messages) + .build(); + } + + public static NotificationEntity from(QualityNotification notification, List assetEntities) { + return NotificationEntity.builder() + .assets(assetEntities) + .bpn(notification.getBpn()) + .description(notification.getDescription()) + .status(NotificationStatusBaseEntity.fromStringValue(notification.getNotificationStatus().name())) + .side(NotificationSideBaseEntity.valueOf(notification.getNotificationSide().name())) + .createdDate(notification.getCreatedAt()) + .type(NotificationTypeEntity.from(notification.getNotificationType())) + .build(); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java new file mode 100644 index 0000000000..f9ce6ca10b --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java @@ -0,0 +1,116 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.experimental.SuperBuilder; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.QualityNotificationMessageBaseEntity; + +import java.util.List; + +@Setter +@Getter +@SuperBuilder +@AllArgsConstructor +@NoArgsConstructor +@Entity +@Table(name = "notification_message") +public class NotificationMessageEntity extends QualityNotificationMessageBaseEntity { + + @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @JoinColumn(name = "notification_id") + private NotificationEntity notification; + + @ManyToMany(cascade = CascadeType.ALL) + @JoinTable( + name = "assets_as_built_notification_messages", + joinColumns = @JoinColumn(name = "notification_message_id"), + inverseJoinColumns = @JoinColumn(name = "asset_id") + ) + private List assets; + + public static QualityNotificationMessage toDomain(NotificationMessageEntity notificationMessageEntity) { + return QualityNotificationMessage.builder() + .id(notificationMessageEntity.getId()) + .notificationReferenceId(notificationMessageEntity.getNotificationReferenceId()) + .createdBy(notificationMessageEntity.getCreatedBy()) + .createdByName(notificationMessageEntity.getCreatedByName()) + .sendTo(notificationMessageEntity.getSendTo()) + .sendToName(notificationMessageEntity.getSendToName()) + .description(notificationMessageEntity.getNotification().getDescription()) + .contractAgreementId(notificationMessageEntity.getContractAgreementId()) + .notificationStatus(QualityNotificationStatus.fromStringValue(notificationMessageEntity.getStatus().name())) + .affectedParts(notificationMessageEntity.getAssets().stream() + .map(asset -> new QualityNotificationAffectedPart(asset.getId())) + .toList()) + .targetDate(notificationMessageEntity.getTargetDate()) + .severity(notificationMessageEntity.getSeverity()) + .edcNotificationId(notificationMessageEntity.getEdcNotificationId()) + .messageId(notificationMessageEntity.getMessageId()) + .created(notificationMessageEntity.getCreated()) + .updated(notificationMessageEntity.getUpdated()) + .type(notificationMessageEntity.getNotification().getType().toDomain()) + .errorMessage(notificationMessageEntity.getErrorMessage()) + .build(); + } + + public static NotificationMessageEntity from(NotificationEntity notificationEntity, + QualityNotificationMessage qualityNotificationMessage, + List notificationAssets) { + return NotificationMessageEntity + .builder() + .id(qualityNotificationMessage.getId()) + .notification(notificationEntity) + .errorMessage(qualityNotificationMessage.getErrorMessage()) + .contractAgreementId(qualityNotificationMessage.getContractAgreementId()) + .created(qualityNotificationMessage.getCreated()) + .createdBy(qualityNotificationMessage.getCreatedBy()) + .createdByName(qualityNotificationMessage.getCreatedByName()) + .sendTo(qualityNotificationMessage.getSendTo()) + .sendToName(qualityNotificationMessage.getSendToName()) + .assets(notificationAssets) + .notificationReferenceId(qualityNotificationMessage.getNotificationReferenceId()) + .targetDate(qualityNotificationMessage.getTargetDate()) + .severity(qualityNotificationMessage.getSeverity()) + .edcNotificationId(qualityNotificationMessage.getEdcNotificationId()) + .status(NotificationStatusBaseEntity.fromStringValue(qualityNotificationMessage.getNotificationStatus().name())) + .messageId(qualityNotificationMessage.getMessageId()) + .build(); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationMessageRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationMessageRepository.java new file mode 100644 index 0000000000..452febb0f0 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationMessageRepository.java @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; + +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JpaNotificationMessageRepository extends JpaRepository { +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java new file mode 100644 index 0000000000..c388582f1d --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java @@ -0,0 +1,52 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; + +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; +import java.util.Optional; + +public interface JpaNotificationRepository extends JpaRepository, JpaSpecificationExecutor { + + long countAllBySideEquals(NotificationSideBaseEntity notificationSide); + + long countAllBySideEqualsAndTypeEquals(NotificationSideBaseEntity notificationSide, NotificationTypeEntity notificationType); + + // TODO findByNotificationMessageEdcNotificationId + @Query("SELECT notification FROM NotificationEntity notification JOIN notification.notificationMessages notificationMessage WHERE notificationMessage.edcNotificationId = :edcNotificationId") + Optional findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); + + // TODO findByNotificationMessageId + @Query("SELECT notification FROM NotificationEntity notification JOIN notification.notificationMessages notificationMessage WHERE notificationMessage.id = :id") + Optional findByNotificationMessageId(@Param("id") String id); + + List findAllByStatusIn(List statuses); + + List findAllByStatusInAndType(List statuses, NotificationTypeEntity type); +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java new file mode 100644 index 0000000000..2fc855855e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java @@ -0,0 +1,237 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; + +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +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.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; +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.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Repository; + +import java.time.Clock; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import static org.apache.commons.collections4.ListUtils.emptyIfNull; + +@Slf4j +@RequiredArgsConstructor +@Repository +@Transactional +public class NotificationRepositoryImpl implements NotificationRepository { + + private final JpaNotificationRepository jpaNotificationRepository; + private final JpaNotificationMessageRepository jpaNotificationMessageRepository; + private final JpaAssetAsBuiltRepository assetsAsBuiltRepository; + + private final Clock clock; + + @PersistenceContext + private EntityManager entityManager; + + @Override + public Optional findOptionalQualityNotificationById(QualityNotificationId notificationId) { + return jpaNotificationRepository.findById(notificationId.value()).map(NotificationEntity::toDomain); + } + + @Override + public Optional findByEdcNotificationId(String edcNotificationId) { + return jpaNotificationRepository.findByNotificationsEdcNotificationId(edcNotificationId).map(NotificationEntity::toDomain); + } + + @Override + public Optional findByNotificationMessageId(String id) { + return jpaNotificationRepository.findByNotificationMessageId(id).map(NotificationEntity::toDomain); + } + + @Override + public long countQualityNotificationEntitiesBySide(QualityNotificationSide notificationSide) { + return jpaNotificationRepository.countAllBySideEquals(NotificationSideBaseEntity.valueOf(notificationSide.name())); + } + + @Override + public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide notificationSide, QualityNotificationType notificationType) { + return jpaNotificationRepository.countAllBySideEqualsAndTypeEquals( + NotificationSideBaseEntity.valueOf(notificationSide.name()), + NotificationTypeEntity.valueOf(notificationType.name()) + ); + } + + @Override + public QualityNotificationId saveQualityNotificationEntity(QualityNotification notification) { + List assetEntities = getAssetEntitiesByNotification(notification); + + if (!assetEntities.isEmpty()) { + NotificationEntity notificationEntity = NotificationEntity.from(notification, assetEntities); + + jpaNotificationRepository.save(notificationEntity); + + notification.getNotifications().forEach(notificationMessage -> handleNotificationCreate(notificationEntity, notificationMessage, assetEntities)); + + return new QualityNotificationId(notificationEntity.getId()); + } else { + throw new IllegalArgumentException("No assets found for %s asset ids".formatted(String.join(", ", notification.getAssetIds()))); + } + } + + @Override + public void updateQualityNotificationEntity(QualityNotification notification) { + NotificationEntity notificationEntity = jpaNotificationRepository.findById(notification.getNotificationId().value()) + .orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", notification.getNotificationId().value()))); + + notificationEntity.setStatus(NotificationStatusBaseEntity.fromStringValue(notification.getNotificationStatus().name())); + notificationEntity.setUpdated(clock.instant()); + notificationEntity.setCloseReason(notification.getCloseReason()); + notificationEntity.setAcceptReason(notification.getAcceptReason()); + notificationEntity.setDeclineReason(notification.getDeclineReason()); + handleNotificationUpdate(notificationEntity, notification); + jpaNotificationRepository.save(notificationEntity); + } + + @Override + public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { + List notificationSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()) + .stream() + .map(NotificationSpecification::new) + .toList(); + Specification specification = NotificationSpecification.toSpecification(notificationSpecifications); + return new PageResult<>(jpaNotificationRepository.findAll(specification, pageable), NotificationEntity::toDomain); + } + + @Override + public long countOpenNotificationsByOwnership(List owners) { + return jpaNotificationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)) + .stream() + .map(NotificationEntity::getAssets) + .flatMap(Collection::stream) + .filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())) + .distinct() + .toList() + .size(); + } + + @Override + public long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType) { + return jpaNotificationRepository.findAllByStatusInAndType( + NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES), + NotificationTypeEntity.from(notificationType)) + .stream() + .map(NotificationEntity::getAssets) + .flatMap(Collection::stream) + .filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())) + .distinct() + .toList() + .size(); + } + + @Override + public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { + return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, NotificationEntity.class, entityManager); + } + + @Override + public void updateErrorMessage(QualityNotification notification) { + log.info("Starting update of error message with notification {}", notification); + NotificationEntity notificationEntity = jpaNotificationRepository.findById(notification.getNotificationId().value()) + .orElseThrow(() -> new IllegalArgumentException(String.format("Notification with id %s not found!", notification.getNotificationId().value()))); + + for (QualityNotificationMessage notificationMessage : notification.getNotifications()) { + List assetEntitiesByNotification = getAssetEntitiesByNotification(notification); + NotificationMessageEntity notificationMessageEntity = toNotificationMessageEntity(notificationEntity, notificationMessage, assetEntitiesByNotification); + Optional optionalNotificationMessage = jpaNotificationMessageRepository.findById(notificationMessageEntity.getId()); + optionalNotificationMessage.ifPresentOrElse(messageEntity -> { + messageEntity.setErrorMessage(notificationMessage.getErrorMessage()); + messageEntity.setUpdated(LocalDateTime.ofInstant(clock.instant(), clock.getZone())); + jpaNotificationMessageRepository.save(notificationMessageEntity); + log.info("Update of error message with notificationMessageEntity {}", notificationMessageEntity); + }, () -> log.info("Could not find notification message by id {}. Error could not be enriched {}", notificationMessage.getId(), notificationMessage.getErrorMessage())); + } + jpaNotificationRepository.save(notificationEntity); + } + + private List getAssetEntitiesByNotification(QualityNotification notification) { + return assetsAsBuiltRepository.findByIdIn(notification.getAssetIds()); + } + + private void handleNotificationCreate(NotificationEntity notificationEntity, QualityNotificationMessage notificationDomain, List assetEntities) { + NotificationMessageEntity notificationMessageEntity = toNotificationMessageEntity(notificationEntity, notificationDomain, assetEntities); + + Optional optionalNotificationMessage = jpaNotificationMessageRepository.findById(notificationMessageEntity.getId()); + + optionalNotificationMessage.ifPresentOrElse( + // If present + investigationNotificationEntity -> log.info("Investigation has the following old notification with id {} and status {}", investigationNotificationEntity.getId(), investigationNotificationEntity.getStatus().name()), + // If not present + () -> { + // Persist + log.info("Investigation has the following new notification with id {} and status {}", notificationMessageEntity.getId(), notificationMessageEntity.getStatus().name()); + jpaNotificationMessageRepository.save(notificationMessageEntity); + log.info("Successfully persisted notification entity {}", notificationMessageEntity); + }); + } + + private NotificationMessageEntity toNotificationMessageEntity(NotificationEntity notificationEntity, QualityNotificationMessage notification, List investigationAssets) { + List notificationAssets = filterNotificationAssets(notification, investigationAssets); + + if (notificationAssets.isEmpty()) { + throw new IllegalStateException("Investigation with id %s has no notification assets".formatted(notificationEntity.getId())); + } + return NotificationMessageEntity.from(notificationEntity, notification, notificationAssets); + } + + private List filterNotificationAssets(QualityNotificationMessage notificationMessage, List assets) { + Set notificationAffectedAssetIds = notificationMessage.getAffectedParts().stream().map(QualityNotificationAffectedPart::assetId).collect(Collectors.toSet()); + + return assets.stream().filter(it -> notificationAffectedAssetIds.contains(it.getId())).toList(); + } + + private void handleNotificationUpdate(NotificationEntity notificationEntity, QualityNotification notification) { + for (QualityNotificationMessage notificationMessage : notification.getNotifications()) { + List assetEntitiesByNotification = getAssetEntitiesByNotification(notification); + handleNotificationCreate(notificationEntity, notificationMessage, assetEntitiesByNotification); + } + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationSpecification.java new file mode 100644 index 0000000000..8e68d0b5f7 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationSpecification.java @@ -0,0 +1,42 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; + +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; +import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.jetbrains.annotations.NotNull; +import org.springframework.data.jpa.domain.Specification; + +public class NotificationSpecification extends BaseSpecification implements Specification { + + public NotificationSpecification(SearchCriteriaFilter criteriaFilter) { + super(criteriaFilter); + } + + @Override + public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { + return createPredicate(getSearchCriteriaFilter(), root, builder); + } +} diff --git a/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql new file mode 100644 index 0000000000..e31926299b --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql @@ -0,0 +1,71 @@ +DROP VIEW IF EXISTS assets_as_built_view; + +DROP TABLE public.assets_as_built_notifications; +-- DROP TABLE notification; +CREATE TABLE public.notification +( + id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1 NO CYCLE), + bpn varchar(255) NULL, + close_reason varchar(1000) NULL, + created timestamp NULL, + description varchar(1000) NULL, + status varchar(50) NULL, + updated timestamp NULL, + side varchar(50) NULL, + accept_reason varchar(1000) NULL, + decline_reason varchar(1000) NULL, + error_message varchar(255) NULL, + type varchar(50) NULL, + CONSTRAINT notification_pk PRIMARY KEY (id) +); + +CREATE TABLE public.notification_message +( + id varchar(255) NOT NULL, + contract_agreement_id varchar(255) NULL, + edc_url varchar(255) NULL, + notification_reference_id varchar(255) NULL, + send_to varchar(255) NULL, + created_by varchar(255) NULL, + notification_id int8 NULL, + target_date timestamp NULL, + severity int4 NULL, + created_by_name varchar(255) NULL, + send_to_name varchar(255) NULL, + edc_notification_id varchar(255) NULL, + status varchar(255) NULL, + created timestamptz NULL, + updated timestamptz NULL, + message_id varchar(255) NULL, + is_initial bool NULL, + CONSTRAINT notification_message_pkey PRIMARY KEY (id), + CONSTRAINT fk_notification_message_notification FOREIGN KEY (notification_id) REFERENCES public.notification (id) +); + +CREATE TABLE public.assets_as_planned_notifications +( + notification_id int8 NOT NULL, + asset_id varchar(255) NOT NULL +); +CREATE TABLE public.assets_as_planned_notification_messages +( + notification_message_id varchar(255) NOT NULL, + asset_id varchar(255) NOT NULL +); + +CREATE TABLE public.assets_as_built_notifications +( + notification_id int8 NOT NULL, + asset_id varchar(255) NOT NULL, + CONSTRAINT fk_asset_entity FOREIGN KEY (asset_id) REFERENCES public.assets_as_built (id), + CONSTRAINT fk_assets_as_built_notifications FOREIGN KEY (notification_id) REFERENCES public.notification (id) +); + + + +CREATE TABLE public.assets_as_built_notification_messages +( + notification_id varchar(255) NOT NULL, + asset_id varchar(255) NOT NULL, + CONSTRAINT fk_notification FOREIGN KEY (notification_id) REFERENCES public.notification_message (id) +); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java index 03bc0b5607..db6bf2537b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java @@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.QualityNotificationTypeRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; @@ -85,7 +86,7 @@ public void testSanitizeStartQualityNotificationRequest() { partIds.add("urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca979\n"); Instant targetDate = Instant.parse("2023-09-22T14:30:00Z".trim()); QualityNotificationSeverityRequest severity = QualityNotificationSeverityRequest.MINOR; - StartQualityNotificationRequest request = new StartQualityNotificationRequest(partIds, "The description\n", targetDate, severity, true, "BPN00001123123AS\n"); + StartQualityNotificationRequest request = new StartQualityNotificationRequest(partIds, "The description\n", targetDate, severity, true, "BPN00001123123AS\n", QualityNotificationTypeRequest.ALERT); //WHEN diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java index 84695b0267..eab2f879f7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java @@ -50,6 +50,7 @@ import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.QualityNotificationTypeRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; @@ -273,6 +274,7 @@ void shouldCancelInvestigation() throws JsonProcessingException, JoseException { val startInvestigationRequest = StartQualityNotificationRequest.builder() .partIds(List.of("urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978")) .description("at least 15 characters long investigation description") + .type(QualityNotificationTypeRequest.INVESTIGATION) .severity(QualityNotificationSeverityRequest.MAJOR) .isAsBuilt(true) .build(); diff --git a/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationTypeRequest.java b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationTypeRequest.java new file mode 100644 index 0000000000..0f1c916f26 --- /dev/null +++ b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationTypeRequest.java @@ -0,0 +1,60 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package qualitynotification.base.request; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; + +import java.util.NoSuchElementException; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@ApiModel(description = "Describes the type of a notification") +public enum QualityNotificationTypeRequest { + ALERT("ALERT"), + INVESTIGATION("INVESTIGATION"); + + final String realName; + + QualityNotificationTypeRequest(final String realName) { + this.realName = realName; + } + + @JsonCreator + public static QualityNotificationTypeRequest fromValue(final String value) { + return Stream.of(QualityNotificationTypeRequest.values()) + .filter(severity -> severity.getRealName().equals(value)) + .findFirst() + .orElseThrow(() -> new NoSuchElementException("Unsupported QualityNotificationTypeRequest: " + value + + ". Must be one of: " + supportedQualityNotificationTypeRequest())); + } + + private static String supportedQualityNotificationTypeRequest() { + return Stream.of(QualityNotificationSeverityRequest.values()) + .map(QualityNotificationSeverityRequest::getRealName) + .collect(Collectors.joining(", ")); + } + + @JsonValue + public String getRealName() { + return realName; + } +} diff --git a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java index ddebe28c65..11b31a5e59 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java @@ -59,4 +59,7 @@ public class StartQualityNotificationRequest { @Schema(example = "BPN00001123123AS") private String receiverBpn; + @Schema(example = "ALERT") + private QualityNotificationTypeRequest type; + } diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java index 64ca222d17..84efc2e374 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java @@ -82,6 +82,10 @@ public class QualityNotificationResponse { @Size(max = 255) private QualityNotificationSeverityResponse severity; + @Schema(example = "ALERT", maxLength = 50) + @Size(max = 50) + private QualityNotificationTypeResponse type; + @Schema(example = "2099-02-21T21:27:10.734950Z", maxLength = 50) @Size(max = 50) private String targetDate; diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationTypeResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationTypeResponse.java new file mode 100644 index 0000000000..a8a229e8a8 --- /dev/null +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationTypeResponse.java @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package qualitynotification.base.response; + +import io.swagger.annotations.ApiModel; + +@ApiModel(description = "Describes the type of a notification") +public enum QualityNotificationTypeResponse { + ALERT, + INVESTIGATION +} From 7d90d720240f5a09e5bc674b9b0019378327152e Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 01:37:57 +0100 Subject: [PATCH 02/13] chore(tx-backend) 706 temp save work --- .../openapi/traceability-foss-backend.json | 2 +- .../asbuilt/model/AssetAsBuiltEntity.java | 41 ++++-- .../asbuilt/model/AssetAsBuiltViewEntity.java | 49 ++++--- .../common/config/ErrorHandlingConfig.java | 7 + .../mapper/NotificationMessageMapper.java | 4 +- .../mapper/QualityNotificationMapper.java | 4 +- .../alert/rest/AlertController.java | 2 +- .../QualityNotificationFieldMapper.java | 12 +- .../rest/InvestigationsController.java | 2 +- .../domain/NotificationNotFoundException.java | 26 ++++ .../alert/service/AlertServiceImpl.java | 53 -------- .../alert/service/AlertsReceiverService.java | 6 +- ...actQualityNotificationReceiverService.java | 11 +- .../AbstractQualityNotificationService.java | 4 +- .../QualityNotificationReceiverService.java | 5 +- .../service/InvestigationServiceImpl.java | 53 -------- .../InvestigationsReceiverService.java | 6 +- .../service/NotificationServiceImpl.java | 4 +- .../infrastructure/edc/EdcController.java | 9 +- ...paInvestigationNotificationRepository.java | 1 - .../model/NotificationEntity.java | 4 +- .../repository/JpaNotificationRepository.java | 7 +- .../NotificationRepositoryImpl.java | 20 +-- .../R__create_asset_as_built_view.sql | 100 +++++++------- ...0__merge_alert_and_notification_tables.sql | 20 ++- .../common/mapper/NotificationMapperTest.java | 4 +- .../mapper/QualityNotificationMapperTest.java | 5 +- .../assets/DashboardControllerIT.java | 14 +- .../support/AlertNotificationsSupport.java | 124 ++++++++++-------- .../common/support/AlertsSupport.java | 33 ++--- .../common/support/DatabaseSupport.java | 15 +-- .../InvestigationNotificationsSupport.java | 124 ++++++++++-------- .../common/support/InvestigationsSupport.java | 31 ++--- .../support/NotificationMessageSupport.java | 41 ++++++ .../common/support/NotificationSupport.java | 96 ++++++++++++++ .../edc/blackbox/EdcControllerIT.java | 46 ++++--- .../alert/AlertsRepositoryIT.java | 9 +- .../alert/PublisherAlertsControllerIT.java | 15 ++- .../alert/ReadAlertsControllerIT.java | 22 ++-- .../PublisherInvestigationsControllerIT.java | 41 +++--- .../ReadInvestigationsControllerIT.java | 12 +- .../alert/rest/AlertControllerTest.java | 2 + .../service/InvestigationServiceImplTest.java | 32 ++--- .../InvestigationsReceiverServiceTest.java | 41 +++--- .../testdata/NotificationTestDataFactory.java | 1 + 45 files changed, 680 insertions(+), 480 deletions(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java create mode 100644 tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java create mode 100644 tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 1e85bd123c..a2f84765e3 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"Tractus-X Traceability Foss","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"},"servers":[{"url":"http://localhost:9998/api","description":"Generated server url"}],"security":[{"oAuth2":["profile email"]}],"tags":[{"name":"Investigations","description":"Operations on Investigation Notification"}],"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":{"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"}}}},"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"}}}},"200":{"description":"Returns the paged result found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"submodelId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns submodel payload","content":{"application/json":{"schema":{"type":"string"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"post":{"tags":["Submodel"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"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"}}}},"204":{"description":"No Content."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications":{"post":{"tags":["Notifications"],"operationId":"alertAssets","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}}}},"/notifications/{notificationId}/update":{"post":{"tags":["Notifications"],"operationId":"updateAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/close":{"post":{"tags":["Notifications"],"operationId":"closeAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/cancel":{"post":{"tags":["Notifications"],"operationId":"cancelAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/approve":{"post":{"tags":["Notifications"],"operationId":"approveAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/filter":{"post":{"tags":["Notifications"],"operationId":"getAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultAlertResponse"}}}}}}}},"/investigations":{"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"}}},"required":true},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/update":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/close":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/cancel":{"post":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/approve":{"post":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/filter":{"post":{"tags":["Investigations"],"summary":"Filter investigations defined by the request body","description":"The endpoint returns investigations as paged result.","operationId":"filterInvestigations","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"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"}}}},"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,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/edc/notification/contract":{"post":{"tags":["Notifications"],"summary":"Triggers EDC notification contract","description":"The endpoint Triggers EDC notification contract based on notification type and method","operationId":"createNotificationContract","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractRequest"}}},"required":true},"responses":{"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/contracts":{"post":{"tags":["Contracts"],"summary":"All contract agreements for all assets","description":"This endpoint returns all contract agreements for all assets in Trace-X","operationId":"contracts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Authorization failed."}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Unsupported media type."}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Forbidden."}}}}},"200":{"description":"Ok.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultContractResponse"}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Too many requests."}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Internal server error."}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Bad request."}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Not found."}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/publish":{"post":{"tags":["AssetsImport","AssetsPublish"],"summary":"asset publish","description":"This endpoint publishes assets to the Catena-X network.","operationId":"publishAssets","parameters":[{"name":"triggerSynchronizeAssets","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAssetRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import":{"post":{"tags":["AssetsImport"],"summary":"asset upload","description":"This endpoint stores assets in the application. Those can be later published in the Catena-X network.","operationId":"importJson","requestBody":{"content":{"multipart/form-data":{"schema":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts":{"post":{"tags":["Alerts"],"summary":"Start alert by part ids","description":"The endpoint starts alert based on part ids provided.","operationId":"alertAssets_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/update":{"post":{"tags":["Alerts"],"summary":"Update alert by id","description":"The endpoint updates alert by their id.","operationId":"updateAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/close":{"post":{"tags":["Alerts"],"summary":"Close alert by id","description":"The endpoint closes alert by id.","operationId":"closeAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/cancel":{"post":{"tags":["Alerts"],"summary":"Cancels alert by id","description":"The endpoint cancels alert by id.","operationId":"cancelAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/approve":{"post":{"tags":["Alerts"],"summary":"Approves alert by id","description":"The endpoint approves alert by id.","operationId":"approveAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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."},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/filter":{"post":{"tags":["Alerts"],"summary":"Filter alerts defined by the request body","description":"The endpoint returns alerts as paged result.","operationId":"filterAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"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"}}}},"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","description":"Alerts","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/{assetId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by id","description":"The endpoint returns an asset filtered by id .","operationId":"assetById","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"patch":{"tags":["AssetsAsPlanned"],"summary":"Updates asset","description":"The endpoint updates asset by provided quality type.","operationId":"updateAsset","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetRequest"}}},"required":true},"responses":{"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}},"required":true},"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the updated asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/registry/reload":{"get":{"tags":["Registry"],"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/policies":{"get":{"tags":["Policies"],"summary":"Get all policies ","description":"The endpoint returns all policies .","operationId":"policy","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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications/{notificationId}":{"get":{"tags":["Notifications"],"operationId":"getAlert","parameters":[{"name":"notificationId","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"}}}}}}}},"/notifications/distinctFilterValues":{"get":{"tags":["Notifications"],"operationId":"distinctFilterValues","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/investigations/{investigationId}":{"get":{"tags":["Investigations"],"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"}}],"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"}}}},"500":{"description":"Internal server error.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/distinctFilterValues":{"get":{"tags":["Assets","Investigations"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/dashboard":{"get":{"tags":["Dashboard"],"summary":"Returns dashboard related data","description":"The endpoint can return limited data based on the user role","operationId":"dashboard","responses":{"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"}}}},"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"}}}},"200":{"description":"Returns dashboard data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import/report/{importJobId}":{"get":{"tags":["ImportReport","AssetsImport"],"summary":"report of the imported assets","description":"This endpoint returns information about the imported assets to Trace-X.","operationId":"importReport","parameters":[{"name":"importJobId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReportResponse"}}}},"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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned":{"get":{"tags":["AssetsAsPlanned"],"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":"filter","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/distinctFilterValues":{"get":{"tags":["Assets","AssetsAsPlanned"],"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":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":false,"schema":{"type":"string"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/*/children/{childId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildIdAndAssetId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built":{"get":{"tags":["AssetsAsBuilt"],"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":"searchCriteriaRequestParam","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/distinctFilterValues":{"get":{"tags":["AssetsAsBuilt","Assets"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"owner","in":"query","required":true,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":{"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"}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/*/children/{childId}":{"get":{"tags":["AssetsAsBuilt"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"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"}}}},"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}":{"get":{"tags":["Alerts"],"summary":"Gets Alert by id","description":"The endpoint returns alert by id.","operationId":"getAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"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"}}}},"500":{"description":"Internal server error.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/distinctFilterValues":{"get":{"tags":["Assets","Alerts"],"summary":"getDistinctFilterValues","description":"The endpoint returns a distinct filter values for given fieldName.","operationId":"distinctFilterValues_4","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"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":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/submodel/data":{"delete":{"tags":["Submodel"],"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"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"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"}}}},"204":{"description":"No Content."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/bpn-config/{bpn}":{"delete":{"tags":["BpnEdcMapping"],"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"}}],"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"}}}},"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"}}}},"204":{"description":"Deleted."},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}}},"components":{"schemas":{"BpnMappingRequest":{"required":["bpn","url"],"type":"object","properties":{"bpn":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"url":{"maxLength":255,"minLength":0,"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"maxLength":1000,"minLength":0,"pattern":"^.*$","type":"string","example":"Access Denied"}}},"BpnEdcMappingResponse":{"type":"object","properties":{"bpn":{"type":"string","example":"BPNL00000003CSGV"},"url":{"type":"string","example":"https://trace-x-test-edc.dev.demo.catena-x.net/a1"}}},"StartQualityNotificationRequest":{"required":["severity"],"type":"object","properties":{"partIds":{"maxLength":100,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"],"items":{"maxLength":100,"minLength":1,"type":"string","example":"[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]"}},"description":{"maxLength":1000,"minLength":15,"type":"string","example":"The description"},"targetDate":{"type":"string","format":"date-time","example":"2099-03-11T22:44:06.333826952Z"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"receiverBpn":{"type":"string","example":"BPN00001123123AS"},"type":{"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"asBuilt":{"type":"boolean"}}},"QualityNotificationIdResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1}}},"UpdateQualityNotificationRequest":{"required":["status"],"type":"object","properties":{"status":{"type":"string","description":"The UpdateInvestigationStatus","enum":["ACKNOWLEDGED","ACCEPTED","DECLINED"]},"reason":{"type":"string","example":"The reason."}}},"CloseQualityNotificationRequest":{"type":"object","properties":{"reason":{"maxLength":1000,"minLength":15,"type":"string","example":"The reason."}}},"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"}}}},"PageableFilterRequest":{"type":"object","properties":{"pageAble":{"$ref":"#/components/schemas/OwnPageable"},"searchCriteria":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}},"SearchCriteriaRequestParam":{"type":"object","properties":{"filter":{"maxItems":2147483647,"type":"array","description":"Filter Criteria","example":"owner,EQUAL,OWN","items":{"type":"string"}}}},"AlertResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"PageResultAlertResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"QualityNotificationMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string"},"sendTo":{"type":"string"},"sendToName":{"type":"string"},"contractAgreementId":{"type":"string"},"notificationReferenceId":{"type":"string"},"targetDate":{"type":"string","format":"date-time"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"edcNotificationId":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"messageId":{"type":"string"},"status":{"type":"string","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"}}},"QualityNotificationReasonResponse":{"type":"object","properties":{"close":{"maxLength":1000,"minLength":0,"type":"string","example":"description of closing reason"},"accept":{"maxLength":1000,"minLength":0,"type":"string","example":"description of accepting reason"},"decline":{"maxLength":1000,"minLength":0,"type":"string","example":"description of declining reason"}}},"InvestigationResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"CreateNotificationContractRequest":{"required":["notificationMethod","notificationType"],"type":"object","properties":{"notificationType":{"type":"string","enum":["QUALITY_INVESTIGATION","QUALITY_ALERT"]},"notificationMethod":{"type":"string","enum":["RECEIVE","UPDATE","RESOLVE"]}}},"CreateNotificationContractResponse":{"type":"object","properties":{"notificationAssetId":{"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"accessPolicyId":{"type":"string","example":"123"},"contractDefinitionId":{"type":"string","example":"456"}}},"ContractResponse":{"type":"object","properties":{"contractId":{"maxLength":255,"type":"string","example":"66"},"counterpartyAddress":{"maxLength":255,"type":"string","example":"https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp"},"creationDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"endDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"state":{"maxLength":255,"type":"string","example":"FINALIZED"},"policy":{"maxLength":255,"type":"string","example":"{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}"}}},"PageResultContractResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"$ref":"#/components/schemas/ContractResponse"}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"RegisterAssetRequest":{"required":["assetIds","policyId"],"type":"object","properties":{"policyId":{"type":"string","example":"a644a7cb-3de5-493b-9259-f01db315a46e"},"assetIds":{"type":"array","items":{"type":"string"}}}},"ImportResponse":{"type":"object","properties":{"jobId":{"type":"string"},"importStateMessage":{"type":"array","items":{"$ref":"#/components/schemas/ImportStateMessage"}},"validationResult":{"$ref":"#/components/schemas/ValidationResponse"}}},"ImportStateMessage":{"type":"object","properties":{"catenaXId":{"type":"string"},"persistedOrUpdated":{"type":"boolean"}}},"ValidationResponse":{"type":"object","properties":{"validationErrors":{"type":"array","items":{"type":"string"}}}},"SyncAssetsRequest":{"type":"object","properties":{"globalAssetIds":{"maxItems":100,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"GetDetailInformationRequest":{"type":"object","properties":{"assetIds":{"maxLength":50,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"maxLength":50,"minLength":1,"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"DescriptionsResponse":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"}}},"DetailAspectDataAsBuiltResponse":{"type":"object","properties":{"partId":{"maxLength":255,"minLength":0,"type":"string","example":"95657762-59"},"customerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"01697F7-65"},"nameAtCustomer":{"maxLength":255,"minLength":0,"type":"string","example":"Door front-left"},"manufacturingCountry":{"maxLength":255,"minLength":0,"type":"string","example":"DEU"},"manufacturingDate":{"maxLength":255,"minLength":0,"type":"string","example":"2022-02-04T13:48:54Z"}}},"DetailAspectDataAsPlannedResponse":{"type":"object","properties":{"validityPeriodFrom":{"maxLength":255,"minLength":0,"type":"string","example":"2022-09-26T12:43:51.079Z"},"validityPeriodTo":{"maxLength":255,"minLength":0,"type":"string","example":"20232-07-13T12:00:00.000Z"}}},"DetailAspectDataResponse":{"type":"object","oneOf":[{"$ref":"#/components/schemas/DetailAspectDataAsBuiltResponse"},{"$ref":"#/components/schemas/DetailAspectDataAsPlannedResponse"},{"$ref":"#/components/schemas/PartSiteInformationAsPlannedResponse"},{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeResponse"}]},"DetailAspectDataTractionBatteryCodeResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"},"subcomponents":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse"}}}},"DetailAspectDataTractionBatteryCodeSubcomponentResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"}}},"DetailAspectModelResponse":{"type":"object","properties":{"type":{"type":"string","example":"PART_SITE_INFORMATION_AS_PLANNED","enum":["AS_BUILT","AS_PLANNED","TRACTION_BATTERY_CODE","SINGLE_LEVEL_BOM_AS_BUILT","SINGLE_LEVEL_USAGE_AS_BUILT","SINGLE_LEVEL_BOM_AS_PLANNED","PART_SITE_INFORMATION_AS_PLANNED"]},"data":{"$ref":"#/components/schemas/DetailAspectDataResponse"}}},"PartSiteInformationAsPlannedResponse":{"type":"object","properties":{"functionValidUntil":{"type":"string","example":"2025-02-08T04:30:48.000Z"},"function":{"type":"string","example":"production"},"functionValidFrom":{"type":"string","example":"2023-10-13T14:30:45+01:00"},"catenaXSiteId":{"type":"string","example":"urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003"}}},"UpdateAssetRequest":{"required":["qualityType"],"type":"object","properties":{"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]}}},"ConstraintResponse":{"type":"object","properties":{"leftOperand":{"type":"string","example":"PURPOSE"},"operatorTypeResponse":{"type":"string","enum":["EQ","NEQ","LT","GT","IN","LTEQ","GTEQ","ISA","HASPART","ISPARTOF","ISONEOF","ISALLOF","ISNONEOF"]},"rightOperand":{"type":"string","example":"ID Trace 3.1"}}},"ConstraintsResponse":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}},"or":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}}}},"PermissionResponse":{"type":"object","properties":{"action":{"type":"string","example":"USE","enum":["ACCESS","USE"]},"constraints":{"$ref":"#/components/schemas/ConstraintsResponse"}}},"PolicyResponse":{"type":"object","properties":{"policyId":{"type":"string","example":"5a00bb50-0253-405f-b9f1-1a3150b9d51d"},"createdOn":{"type":"string","format":"date-time"},"validUntil":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionResponse"}}}},"DashboardResponse":{"type":"object","properties":{"asBuiltCustomerParts":{"type":"integer","format":"int64","example":5},"asPlannedCustomerParts":{"type":"integer","format":"int64","example":10},"asBuiltSupplierParts":{"type":"integer","format":"int64","example":2},"asPlannedSupplierParts":{"type":"integer","format":"int64","example":3},"asBuiltOwnParts":{"type":"integer","format":"int64","example":1},"asPlannedOwnParts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"customerPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"customerPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"receivedActiveAlerts":{"type":"integer","format":"int64","example":2},"receivedActiveInvestigations":{"type":"integer","format":"int64","example":2},"sentActiveAlerts":{"type":"integer","format":"int64","example":2},"sentActiveInvestigations":{"type":"integer","format":"int64","example":2}}},"ImportJobResponse":{"type":"object","properties":{"importJobStatus":{"type":"string","enum":["INITIALIZING","RUNNING","ERROR","COMPLETED"]},"importId":{"type":"string","example":"456a952e-05eb-40dc-a6f2-9c2cb9c1387f"},"startedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"completedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"}}},"ImportReportResponse":{"type":"object","properties":{"importJob":{"$ref":"#/components/schemas/ImportJobResponse"},"importedAsset":{"type":"array","items":{"$ref":"#/components/schemas/ImportedAssetResponse"}}}},"ImportedAssetResponse":{"type":"object","properties":{"importState":{"type":"string","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"catenaxId":{"type":"string","example":"urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}"},"importedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"importMessage":{"type":"string","example":"Asset created successfully in transient state."}}}},"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://example.com/api/oauth/token","scopes":{"profile email":""}}}}}}} \ No newline at end of file +{"openapi":"3.0.1","info":{"title":"Tractus-X Traceability Foss","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"},"servers":[{"url":"http://localhost:9998/api","description":"Generated server url"}],"security":[{"oAuth2":["profile email"]}],"tags":[{"name":"Investigations","description":"Operations on Investigation Notification"}],"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":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for BpnEdcMapping","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for BpnEdcMapping","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"submodelId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns submodel payload","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"oAuth2":["profile email"]}]},"post":{"tags":["Submodel"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."}},"security":[{"oAuth2":["profile email"]}]}},"/notifications":{"post":{"tags":["Notifications"],"operationId":"alertAssets","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}}}},"/notifications/{notificationId}/update":{"post":{"tags":["Notifications"],"operationId":"updateAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/close":{"post":{"tags":["Notifications"],"operationId":"closeAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/cancel":{"post":{"tags":["Notifications"],"operationId":"cancelAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/approve":{"post":{"tags":["Notifications"],"operationId":"approveAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/filter":{"post":{"tags":["Notifications"],"operationId":"getAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultAlertResponse"}}}}}}}},"/investigations":{"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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/update":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/close":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/cancel":{"post":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/approve":{"post":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/filter":{"post":{"tags":["Investigations"],"summary":"Filter investigations defined by the request body","description":"The endpoint returns investigations as paged result.","operationId":"filterInvestigations","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"maxItems":2147483647,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/edc/notification/contract":{"post":{"tags":["Notifications"],"summary":"Triggers EDC notification contract","description":"The endpoint Triggers EDC notification contract based on notification type and method","operationId":"createNotificationContract","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/contracts":{"post":{"tags":["Contracts"],"summary":"All contract agreements for all assets","description":"This endpoint returns all contract agreements for all assets in Trace-X","operationId":"contracts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Internal server error."}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Not found."}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Forbidden."}}}}},"200":{"description":"Ok.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultContractResponse"}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Unsupported media type."}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Authorization failed."}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Bad request."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Too many requests."}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/publish":{"post":{"tags":["AssetsImport","AssetsPublish"],"summary":"asset publish","description":"This endpoint publishes assets to the Catena-X network.","operationId":"publishAssets","parameters":[{"name":"triggerSynchronizeAssets","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAssetRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import":{"post":{"tags":["AssetsImport"],"summary":"asset upload","description":"This endpoint stores assets in the application. Those can be later published in the Catena-X network.","operationId":"importJson","requestBody":{"content":{"multipart/form-data":{"schema":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts":{"post":{"tags":["Alerts"],"summary":"Start alert by part ids","description":"The endpoint starts alert based on part ids provided.","operationId":"alertAssets_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/update":{"post":{"tags":["Alerts"],"summary":"Update alert by id","description":"The endpoint updates alert by their id.","operationId":"updateAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/close":{"post":{"tags":["Alerts"],"summary":"Close alert by id","description":"The endpoint closes alert by id.","operationId":"closeAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/cancel":{"post":{"tags":["Alerts"],"summary":"Cancels alert by id","description":"The endpoint cancels alert by id.","operationId":"cancelAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/approve":{"post":{"tags":["Alerts"],"summary":"Approves alert by id","description":"The endpoint approves alert by id.","operationId":"approveAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/filter":{"post":{"tags":["Alerts"],"summary":"Filter alerts defined by the request body","description":"The endpoint returns alerts as paged result.","operationId":"filterAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/{assetId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by id","description":"The endpoint returns an asset filtered by id .","operationId":"assetById","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","content":{"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"patch":{"tags":["AssetsAsPlanned"],"summary":"Updates asset","description":"The endpoint updates asset by provided quality type.","operationId":"updateAsset","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the updated asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/registry/reload":{"get":{"tags":["Registry"],"summary":"Triggers reload of shell descriptors","description":"The endpoint Triggers reload of shell descriptors.","operationId":"reload","responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"202":{"description":"Created registry reload job."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/policies":{"get":{"tags":["Policies"],"summary":"Get all policies ","description":"The endpoint returns all policies .","operationId":"policy","responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications/{notificationId}":{"get":{"tags":["Notifications"],"operationId":"getAlert","parameters":[{"name":"notificationId","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"}}}}}}}},"/notifications/distinctFilterValues":{"get":{"tags":["Notifications"],"operationId":"distinctFilterValues","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/investigations/{investigationId}":{"get":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"$ref":"#/components/schemas/InvestigationResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/distinctFilterValues":{"get":{"tags":["Assets","Investigations"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/dashboard":{"get":{"tags":["Dashboard"],"summary":"Returns dashboard related data","description":"The endpoint can return limited data based on the user role","operationId":"dashboard","responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns dashboard data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import/report/{importJobId}":{"get":{"tags":["ImportReport","AssetsImport"],"summary":"report of the imported assets","description":"This endpoint returns information about the imported assets to Trace-X.","operationId":"importReport","parameters":[{"name":"importJobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReportResponse"}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned":{"get":{"tags":["AssetsAsPlanned"],"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":"filter","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/distinctFilterValues":{"get":{"tags":["Assets","AssetsAsPlanned"],"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":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":false,"schema":{"type":"string"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/*/children/{childId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildIdAndAssetId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built":{"get":{"tags":["AssetsAsBuilt"],"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":"searchCriteriaRequestParam","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/distinctFilterValues":{"get":{"tags":["AssetsAsBuilt","Assets"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"owner","in":"query","required":true,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/*/children/{childId}":{"get":{"tags":["AssetsAsBuilt"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}":{"get":{"tags":["Alerts"],"summary":"Gets Alert by id","description":"The endpoint returns alert by id.","operationId":"getAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/distinctFilterValues":{"get":{"tags":["Assets","Alerts"],"summary":"getDistinctFilterValues","description":"The endpoint returns a distinct filter values for given fieldName.","operationId":"distinctFilterValues_4","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/submodel/data":{"delete":{"tags":["Submodel"],"summary":"Delete All Submodels","description":"Deletes all submodels from the system.","operationId":"deleteSubmodels","responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."}},"security":[{"oAuth2":["profile email"]}]}},"/bpn-config/{bpn}":{"delete":{"tags":["BpnEdcMapping"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"Deleted."},"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"}}}},"200":{"description":"Okay"}},"security":[{"oAuth2":["profile email"]}]}}},"components":{"schemas":{"BpnMappingRequest":{"required":["bpn","url"],"type":"object","properties":{"bpn":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"url":{"maxLength":255,"minLength":0,"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"maxLength":1000,"minLength":0,"pattern":"^.*$","type":"string","example":"Access Denied"}}},"BpnEdcMappingResponse":{"type":"object","properties":{"bpn":{"type":"string","example":"BPNL00000003CSGV"},"url":{"type":"string","example":"https://trace-x-test-edc.dev.demo.catena-x.net/a1"}}},"StartQualityNotificationRequest":{"required":["severity"],"type":"object","properties":{"partIds":{"maxLength":100,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"],"items":{"maxLength":100,"minLength":1,"type":"string","example":"[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]"}},"description":{"maxLength":1000,"minLength":15,"type":"string","example":"The description"},"targetDate":{"type":"string","format":"date-time","example":"2099-03-11T22:44:06.333826952Z"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"receiverBpn":{"type":"string","example":"BPN00001123123AS"},"type":{"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"asBuilt":{"type":"boolean"}}},"QualityNotificationIdResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1}}},"UpdateQualityNotificationRequest":{"required":["status"],"type":"object","properties":{"status":{"type":"string","description":"The UpdateInvestigationStatus","enum":["ACKNOWLEDGED","ACCEPTED","DECLINED"]},"reason":{"type":"string","example":"The reason."}}},"CloseQualityNotificationRequest":{"type":"object","properties":{"reason":{"maxLength":1000,"minLength":15,"type":"string","example":"The reason."}}},"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"}}}},"PageableFilterRequest":{"type":"object","properties":{"pageAble":{"$ref":"#/components/schemas/OwnPageable"},"searchCriteria":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}},"SearchCriteriaRequestParam":{"type":"object","properties":{"filter":{"maxItems":2147483647,"type":"array","description":"Filter Criteria","example":"owner,EQUAL,OWN","items":{"type":"string"}}}},"AlertResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"PageResultAlertResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"QualityNotificationMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string"},"sendTo":{"type":"string"},"sendToName":{"type":"string"},"contractAgreementId":{"type":"string"},"notificationReferenceId":{"type":"string"},"targetDate":{"type":"string","format":"date-time"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"edcNotificationId":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"messageId":{"type":"string"},"status":{"type":"string","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"}}},"QualityNotificationReasonResponse":{"type":"object","properties":{"close":{"maxLength":1000,"minLength":0,"type":"string","example":"description of closing reason"},"accept":{"maxLength":1000,"minLength":0,"type":"string","example":"description of accepting reason"},"decline":{"maxLength":1000,"minLength":0,"type":"string","example":"description of declining reason"}}},"InvestigationResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"CreateNotificationContractRequest":{"required":["notificationMethod","notificationType"],"type":"object","properties":{"notificationType":{"type":"string","enum":["QUALITY_INVESTIGATION","QUALITY_ALERT"]},"notificationMethod":{"type":"string","enum":["RECEIVE","UPDATE","RESOLVE"]}}},"CreateNotificationContractResponse":{"type":"object","properties":{"notificationAssetId":{"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"accessPolicyId":{"type":"string","example":"123"},"contractDefinitionId":{"type":"string","example":"456"}}},"ContractResponse":{"type":"object","properties":{"contractId":{"maxLength":255,"type":"string","example":"66"},"counterpartyAddress":{"maxLength":255,"type":"string","example":"https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp"},"creationDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"endDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"state":{"maxLength":255,"type":"string","example":"FINALIZED"},"policy":{"maxLength":255,"type":"string","example":"{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}"}}},"PageResultContractResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"$ref":"#/components/schemas/ContractResponse"}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"RegisterAssetRequest":{"required":["assetIds","policyId"],"type":"object","properties":{"policyId":{"type":"string","example":"a644a7cb-3de5-493b-9259-f01db315a46e"},"assetIds":{"type":"array","items":{"type":"string"}}}},"ImportResponse":{"type":"object","properties":{"jobId":{"type":"string"},"importStateMessage":{"type":"array","items":{"$ref":"#/components/schemas/ImportStateMessage"}},"validationResult":{"$ref":"#/components/schemas/ValidationResponse"}}},"ImportStateMessage":{"type":"object","properties":{"catenaXId":{"type":"string"},"persistedOrUpdated":{"type":"boolean"}}},"ValidationResponse":{"type":"object","properties":{"validationErrors":{"type":"array","items":{"type":"string"}}}},"SyncAssetsRequest":{"type":"object","properties":{"globalAssetIds":{"maxItems":100,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"GetDetailInformationRequest":{"type":"object","properties":{"assetIds":{"maxLength":50,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"maxLength":50,"minLength":1,"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"DescriptionsResponse":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"}}},"DetailAspectDataAsBuiltResponse":{"type":"object","properties":{"partId":{"maxLength":255,"minLength":0,"type":"string","example":"95657762-59"},"customerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"01697F7-65"},"nameAtCustomer":{"maxLength":255,"minLength":0,"type":"string","example":"Door front-left"},"manufacturingCountry":{"maxLength":255,"minLength":0,"type":"string","example":"DEU"},"manufacturingDate":{"maxLength":255,"minLength":0,"type":"string","example":"2022-02-04T13:48:54Z"}}},"DetailAspectDataAsPlannedResponse":{"type":"object","properties":{"validityPeriodFrom":{"maxLength":255,"minLength":0,"type":"string","example":"2022-09-26T12:43:51.079Z"},"validityPeriodTo":{"maxLength":255,"minLength":0,"type":"string","example":"20232-07-13T12:00:00.000Z"}}},"DetailAspectDataResponse":{"type":"object","oneOf":[{"$ref":"#/components/schemas/DetailAspectDataAsBuiltResponse"},{"$ref":"#/components/schemas/DetailAspectDataAsPlannedResponse"},{"$ref":"#/components/schemas/PartSiteInformationAsPlannedResponse"},{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeResponse"}]},"DetailAspectDataTractionBatteryCodeResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"},"subcomponents":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse"}}}},"DetailAspectDataTractionBatteryCodeSubcomponentResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"}}},"DetailAspectModelResponse":{"type":"object","properties":{"type":{"type":"string","example":"PART_SITE_INFORMATION_AS_PLANNED","enum":["AS_BUILT","AS_PLANNED","TRACTION_BATTERY_CODE","SINGLE_LEVEL_BOM_AS_BUILT","SINGLE_LEVEL_USAGE_AS_BUILT","SINGLE_LEVEL_BOM_AS_PLANNED","PART_SITE_INFORMATION_AS_PLANNED"]},"data":{"$ref":"#/components/schemas/DetailAspectDataResponse"}}},"PartSiteInformationAsPlannedResponse":{"type":"object","properties":{"functionValidUntil":{"type":"string","example":"2025-02-08T04:30:48.000Z"},"function":{"type":"string","example":"production"},"functionValidFrom":{"type":"string","example":"2023-10-13T14:30:45+01:00"},"catenaXSiteId":{"type":"string","example":"urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003"}}},"UpdateAssetRequest":{"required":["qualityType"],"type":"object","properties":{"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]}}},"ConstraintResponse":{"type":"object","properties":{"leftOperand":{"type":"string","example":"PURPOSE"},"operatorTypeResponse":{"type":"string","enum":["EQ","NEQ","LT","GT","IN","LTEQ","GTEQ","ISA","HASPART","ISPARTOF","ISONEOF","ISALLOF","ISNONEOF"]},"rightOperand":{"type":"string","example":"ID Trace 3.1"}}},"ConstraintsResponse":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}},"or":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}}}},"PermissionResponse":{"type":"object","properties":{"action":{"type":"string","example":"USE","enum":["ACCESS","USE"]},"constraints":{"$ref":"#/components/schemas/ConstraintsResponse"}}},"PolicyResponse":{"type":"object","properties":{"policyId":{"type":"string","example":"5a00bb50-0253-405f-b9f1-1a3150b9d51d"},"createdOn":{"type":"string","format":"date-time"},"validUntil":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionResponse"}}}},"DashboardResponse":{"type":"object","properties":{"asBuiltCustomerParts":{"type":"integer","format":"int64","example":5},"asPlannedCustomerParts":{"type":"integer","format":"int64","example":10},"asBuiltSupplierParts":{"type":"integer","format":"int64","example":2},"asPlannedSupplierParts":{"type":"integer","format":"int64","example":3},"asBuiltOwnParts":{"type":"integer","format":"int64","example":1},"asPlannedOwnParts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"customerPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"customerPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"receivedActiveAlerts":{"type":"integer","format":"int64","example":2},"receivedActiveInvestigations":{"type":"integer","format":"int64","example":2},"sentActiveAlerts":{"type":"integer","format":"int64","example":2},"sentActiveInvestigations":{"type":"integer","format":"int64","example":2}}},"ImportJobResponse":{"type":"object","properties":{"importJobStatus":{"type":"string","enum":["INITIALIZING","RUNNING","ERROR","COMPLETED"]},"importId":{"type":"string","example":"456a952e-05eb-40dc-a6f2-9c2cb9c1387f"},"startedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"completedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"}}},"ImportReportResponse":{"type":"object","properties":{"importJob":{"$ref":"#/components/schemas/ImportJobResponse"},"importedAsset":{"type":"array","items":{"$ref":"#/components/schemas/ImportedAssetResponse"}}}},"ImportedAssetResponse":{"type":"object","properties":{"importState":{"type":"string","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"catenaxId":{"type":"string","example":"urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}"},"importedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"importMessage":{"type":"string","example":"Asset created successfully in transient state."}}}},"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://example.com/api/oauth/token","scopes":{"profile email":""}}}}}}} \ No newline at end of file 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 889f2e92e2..7a36bfcf9e 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 @@ -42,9 +42,10 @@ 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.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.submodel.infrastructure.model.SubmodelPayloadEntity; import java.time.Instant; @@ -83,10 +84,8 @@ public class AssetAsBuiltEntity extends AssetBaseEntity { private List parentDescriptors; @ManyToMany(mappedBy = "assets") - private List investigations = new ArrayList<>(); + private List notifications = new ArrayList<>(); - @ManyToMany(mappedBy = "assets") - private List alerts = new ArrayList<>(); @OneToMany(mappedBy = "assetAsBuilt", fetch = FetchType.EAGER) private List submodels; @@ -151,10 +150,34 @@ public AssetBase toDomain() { .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()) + .sentQualityAlerts( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.SENDER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.ALERT.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .receivedQualityAlerts( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.RECEIVER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.ALERT.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .sentQualityInvestigations( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.SENDER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.INVESTIGATION.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .receivedQualityInvestigations( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.RECEIVER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.INVESTIGATION.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) .importState(this.getImportState()) .importNote(this.getImportNote()) .policyId(this.getPolicyId()) 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 27c10052d7..22bc4b66da 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 @@ -39,9 +39,9 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.aspect.DetailAspectModel; import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.SemanticDataModelEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.springframework.data.annotation.Immutable; import java.time.Instant; @@ -85,17 +85,10 @@ public class AssetAsBuiltViewEntity extends AssetBaseEntity { @ManyToMany @JoinTable( - name = "assets_as_built_investigations", + name = "assets_as_built_notifications", 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<>(); + inverseJoinColumns = @JoinColumn(name = "notification_id")) + private List notifications = new ArrayList<>(); public AssetBase toDomain() { return AssetBase.builder() @@ -121,10 +114,34 @@ public AssetBase toDomain() { .importState(this.getImportState()) .policyId(this.getPolicyId()) .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()) + .sentQualityAlerts( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.SENDER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.ALERT.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .receivedQualityAlerts( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.RECEIVER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.ALERT.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .sentQualityInvestigations( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.SENDER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.INVESTIGATION.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) + .receivedQualityInvestigations( + emptyIfNull(this.notifications).stream() + .filter(notification -> NotificationSideBaseEntity.RECEIVER.equals(notification.getSide())) + .filter(notification -> NotificationTypeEntity.INVESTIGATION.equals(notification.getType())) + .map(NotificationEntity::toDomain) + .toList() + ) .tombstone(this.getTombstone()) .contractAgreementId(this.getContractAgreementId()) .build(); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index 124aa58ee8..423b0ae0c1 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -44,6 +44,7 @@ import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; @@ -158,6 +159,12 @@ ResponseEntity handleAlertNotFoundException(AlertNotFoundExceptio return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(new ErrorResponse(exception.getMessage())); } + @ExceptionHandler(NotificationNotFoundException.class) + ResponseEntity handleNotificationNotFoundException(NotificationNotFoundException exception) { + log.warn("handleNotificationNotFoundException", exception); + return ResponseEntity.status(HttpStatus.NOT_FOUND) + .body(new ErrorResponse(exception.getMessage())); + } @ExceptionHandler(InvestigationStatusTransitionNotAllowed.class) ResponseEntity handleInvestigationStatusTransitionNotAllowed(InvestigationStatusTransitionNotAllowed exception) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMessageMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMessageMapper.java index 12eb13a0e9..ef15863a52 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMessageMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMessageMapper.java @@ -24,6 +24,7 @@ import org.eclipse.tractusx.traceability.bpn.domain.service.BpnRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.springframework.stereotype.Component; @@ -42,7 +43,7 @@ public class NotificationMessageMapper { // rename to QualityNotificationMessage * @param edcNotification the EDCNotification received by the receiver * @return a Notification object representing the notification received by the receiver */ - public QualityNotificationMessage toNotification(EDCNotification edcNotification) { + public QualityNotificationMessage toNotification(EDCNotification edcNotification, QualityNotificationType type) { String notificationId = UUID.randomUUID().toString(); return QualityNotificationMessage.builder() .id(notificationId) @@ -50,6 +51,7 @@ public QualityNotificationMessage toNotification(EDCNotification edcNotification .notificationReferenceId(edcNotification.getNotificationId()) .createdBy(edcNotification.getSenderBPN()) .createdByName(getManufacturerName(edcNotification.getSenderBPN())) + .type(type) .sendTo(edcNotification.getRecipientBPN()) .sendToName(getManufacturerName(edcNotification.getRecipientBPN())) .description(edcNotification.getInformation()) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapper.java index 6458decf86..393706d11f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapper.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.springframework.stereotype.Component; import java.time.Instant; @@ -45,7 +46,7 @@ public class QualityNotificationMapper { * @param notification the notification associated with the alert or investigation * @return an QualityNotification object representing the notification received by the receiver */ - public QualityNotification toQualityNotification(BPN bpn, String description, QualityNotificationMessage notification) { + public QualityNotification toQualityNotification(BPN bpn, String description, QualityNotificationMessage notification, QualityNotificationType notificationType) { List assetIds = new ArrayList<>(); notification.getAffectedParts().stream() @@ -55,6 +56,7 @@ public QualityNotification toQualityNotification(BPN bpn, String description, Qu .bpn(bpn) .notificationStatus(QualityNotificationStatus.RECEIVED) .notificationSide(QualityNotificationSide.RECEIVER) + .notificationType(notificationType) .description(description) .createdAt(Instant.now()) .assetIds(assetIds) 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 2fdb24f7cb..caea1f095a 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 @@ -80,7 +80,7 @@ public class AlertController { private final BaseRequestFieldMapper fieldMapper; public AlertController( - @Qualifier("alertServiceImpl") QualityNotificationService alertService, + @Qualifier("notificationServiceImpl") QualityNotificationService alertService, QualityNotificationFieldMapper fieldMapper) { this.alertService = alertService; this.fieldMapper = fieldMapper; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java index 8393c39691..0f03fb8099 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java @@ -38,12 +38,12 @@ public class QualityNotificationFieldMapper extends BaseRequestFieldMapper { Map.entry("close", "closeReason"), Map.entry("accept", "acceptReason"), Map.entry("decline", "declineReason"), - Map.entry("severity", "notifications_severity"), - Map.entry("createdBy", "notifications_createdBy"), - Map.entry("createdByName", "notifications_createdByName"), - Map.entry("sendTo", "notifications_sendTo"), - Map.entry("sendToName", "notifications_sendToName"), - Map.entry("targetDate", "notifications_targetDate"), + Map.entry("severity", "messages_severity"), + Map.entry("createdBy", "messages_createdBy"), + Map.entry("createdByName", "messages_createdByName"), + Map.entry("sendTo", "messages_sendTo"), + Map.entry("sendToName", "messages_sendToName"), + Map.entry("targetDate", "messages_targetDate"), Map.entry("assetId", "assets_id"), Map.entry("type", "type") 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 259062ba8c..7564d12604 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 @@ -81,7 +81,7 @@ public class InvestigationsController { private final BaseRequestFieldMapper fieldMapper; public InvestigationsController( - @Qualifier("investigationServiceImpl") QualityNotificationService investigationService, + @Qualifier("notificationServiceImpl") QualityNotificationService investigationService, QualityNotificationFieldMapper fieldMapper) { this.investigationService = investigationService; this.fieldMapper = fieldMapper; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java new file mode 100644 index 0000000000..f668f13b5e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java @@ -0,0 +1,26 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.qualitynotification.domain; + +public class NotificationNotFoundException extends RuntimeException{ + public NotificationNotFoundException(String notificationId) { + super("Notification with id: %s not found".formatted(notificationId)); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java deleted file mode 100644 index 729ffec227..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java +++ /dev/null @@ -1,53 +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.qualitynotification.domain.alert.service; - -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; -import org.springframework.stereotype.Service; - -@Slf4j -@Service("alertServiceImpl") -public class AlertServiceImpl extends AbstractQualityNotificationService { - - - private final NotificationRepository notificationRepository; - - public AlertServiceImpl(TraceabilityProperties traceabilityProperties, NotificationRepository alertRepository, NotificationPublisherService notificationPublisherService) { - super(traceabilityProperties, notificationPublisherService); - this.notificationRepository = alertRepository; - } - - @Override - protected QualityNotificationRepository getQualityNotificationRepository() { - return notificationRepository; - } - - @Override - public RuntimeException getNotFoundException(String message) { - return new AlertNotFoundException(message); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java index 216ed43e80..bcf2afdf89 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java @@ -25,7 +25,7 @@ import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; import org.springframework.stereotype.Component; @@ -35,14 +35,14 @@ @Component public class AlertsReceiverService extends AbstractQualityNotificationReceiverService { - private final AlertRepository alertRepository; + private final NotificationRepository notificationRepository; private final NotificationMessageMapper notificationMapper; private final QualityNotificationMapper qualityNotificationMapper; @Override protected QualityNotificationRepository getRepository() { - return alertRepository; + return notificationRepository; } @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java index 02a122afb2..7ea57021b3 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java @@ -25,6 +25,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; @@ -42,17 +43,17 @@ public abstract class AbstractQualityNotificationReceiverService implements Qual protected abstract RuntimeException getIllegalUpdateException(String message); @Override - public void handleReceive(EDCNotification edcNotification) { + public void handleReceive(EDCNotification edcNotification, QualityNotificationType notificationType) { BPN investigationCreatorBPN = BPN.of(edcNotification.getSenderBPN()); - QualityNotificationMessage notification = getNotificationMessageMapper().toNotification(edcNotification); - QualityNotification investigation = getQualityNotificationMapper().toQualityNotification(investigationCreatorBPN, edcNotification.getInformation(), notification); + QualityNotificationMessage notification = getNotificationMessageMapper().toNotification(edcNotification, notificationType); + QualityNotification investigation = getQualityNotificationMapper().toQualityNotification(investigationCreatorBPN, edcNotification.getInformation(), notification, notificationType); QualityNotificationId investigationId = getRepository().saveQualityNotificationEntity(investigation); log.info("Stored received edcNotification in investigation with id {}", investigationId); } @Override - public void handleUpdate(EDCNotification edcNotification) { - QualityNotificationMessage notification = getNotificationMessageMapper().toNotification(edcNotification); + public void handleUpdate(EDCNotification edcNotification, QualityNotificationType notificationType) { + QualityNotificationMessage notification = getNotificationMessageMapper().toNotification(edcNotification, notificationType); QualityNotification qualityNotification = getRepository().findByEdcNotificationId(edcNotification.getNotificationId()) .orElseThrow(() -> getNotFoundException(edcNotification.getNotificationId())); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 9a143883e6..4390447f72 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -47,7 +47,7 @@ public abstract class AbstractQualityNotificationService implements QualityNotif private final TraceabilityProperties traceabilityProperties; private final NotificationPublisherService notificationPublisherService; - private static final List SUPPORTED_ENUM_FIELDS = List.of("status", "side", "notifications_severity"); + private static final List SUPPORTED_ENUM_FIELDS = List.of("status", "side", "messages_severity"); protected abstract QualityNotificationRepository getQualityNotificationRepository(); @@ -179,7 +179,7 @@ private List getAssetEnumFieldValues(String fieldName) { return switch (fieldName) { case "status" -> Arrays.stream(QualityNotificationStatus.values()).map(Enum::name).toList(); case "side" -> Arrays.stream(QualityNotificationSide.values()).map(Enum::name).toList(); - case "notifications_severity" -> + case "messages_severity" -> Arrays.stream(QualityNotificationSeverity.values()).map(Enum::name).toList(); default -> null; }; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/QualityNotificationReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/QualityNotificationReceiverService.java index 9d692ebb99..cb7fa3ee8f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/QualityNotificationReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/QualityNotificationReceiverService.java @@ -18,11 +18,12 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.qualitynotification.domain.base.service; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; public interface QualityNotificationReceiverService { - void handleReceive(EDCNotification edcNotification); + void handleReceive(EDCNotification edcNotification, QualityNotificationType notificationType); - void handleUpdate(EDCNotification edcNotification); + void handleUpdate(EDCNotification edcNotification, QualityNotificationType notificationType); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java deleted file mode 100644 index 53bf99279e..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImpl.java +++ /dev/null @@ -1,53 +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.qualitynotification.domain.investigation.service; - -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; -import org.springframework.stereotype.Service; - -@Slf4j -@Service("investigationServiceImpl") -public class InvestigationServiceImpl extends AbstractQualityNotificationService { - - private final NotificationRepository notificationRepository; - - public InvestigationServiceImpl(TraceabilityProperties traceabilityProperties, NotificationRepository notificationRepository, NotificationPublisherService notificationPublisherService) { - super(traceabilityProperties, notificationPublisherService); - this.notificationRepository = notificationRepository; - } - - @Override - protected QualityNotificationRepository getQualityNotificationRepository() { - return notificationRepository; - } - - @Override - public RuntimeException getNotFoundException(String message) { - return new InvestigationNotFoundException(message); - } - - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java index eb09335a40..27935df5df 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java @@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.mapper.NotificationMessageMapper; import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; @@ -37,13 +37,13 @@ @Component public class InvestigationsReceiverService extends AbstractQualityNotificationReceiverService { - private final InvestigationRepository investigationsRepository; + private final NotificationRepository notificationRepository; private final NotificationMessageMapper notificationMapper; private final QualityNotificationMapper qualityNotificationMapper; @Override protected QualityNotificationRepository getRepository() { - return investigationsRepository; + return notificationRepository; } @Override diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java index ffa97a50b2..5ef155757d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java @@ -20,7 +20,7 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.service; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; @@ -45,6 +45,6 @@ protected QualityNotificationRepository getQualityNotificationRepository() { @Override public RuntimeException getNotFoundException(String message) { - return new AlertNotFoundException(message); + return new NotificationNotFoundException(message); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java index d1ecbbea41..d06d6720c4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java @@ -32,6 +32,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.service.AlertsReceiverService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service.InvestigationsReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; @@ -110,7 +111,7 @@ public void qualityNotificationInvestigationReceive(final @ValidEDCNotification EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityNotificationReceive] notificationId:{}", cleanEdcNotification); validateIsQualityInvestigation(cleanEdcNotification); - investigationsReceiverService.handleReceive(cleanEdcNotification); + investigationsReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.INVESTIGATION); } /** @@ -171,7 +172,7 @@ public void qualityNotificationInvestigationUpdate(final @ValidEDCNotification @ EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityNotificationUpdate] notificationId:{}", cleanEdcNotification); validateIsQualityInvestigation(cleanEdcNotification); - investigationsReceiverService.handleUpdate(cleanEdcNotification); + investigationsReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.INVESTIGATION); } /** @@ -231,7 +232,7 @@ public void qualityNotificationAlertReceive(final @ValidEDCNotification @Valid @ EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityalertReceive] notificationId:{}", cleanEdcNotification); validateIsAlert(cleanEdcNotification); - alertsReceiverService.handleReceive(cleanEdcNotification); + alertsReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.ALERT); } /** @@ -291,7 +292,7 @@ public void qualityNotificationAlertUpdate(final @ValidEDCNotification @Valid @R EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityalertUpdate] notificationId:{}", cleanEdcNotification); validateIsAlert(cleanEdcNotification); - alertsReceiverService.handleUpdate(cleanEdcNotification); + alertsReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.ALERT); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java index 7394438a94..667951efcc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java @@ -25,5 +25,4 @@ @Repository public interface JpaInvestigationNotificationRepository extends JpaRepository { - } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java index 4b91945aa6..7230f22ca9 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java @@ -70,10 +70,10 @@ public class NotificationEntity extends NotificationBaseEntity { private List assets; @OneToMany(mappedBy = "notification") - private List notificationMessages; + private List messages; public static QualityNotification toDomain(NotificationEntity notificationEntity) { - List messages = emptyIfNull(notificationEntity.getNotificationMessages()).stream() + List messages = emptyIfNull(notificationEntity.getMessages()).stream() .map(NotificationMessageEntity::toDomain) .toList(); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java index c388582f1d..b09d416aa0 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java @@ -19,7 +19,6 @@ package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; @@ -28,10 +27,12 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; import java.util.List; import java.util.Optional; +@Repository public interface JpaNotificationRepository extends JpaRepository, JpaSpecificationExecutor { long countAllBySideEquals(NotificationSideBaseEntity notificationSide); @@ -39,11 +40,11 @@ public interface JpaNotificationRepository extends JpaRepository findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); // TODO findByNotificationMessageId - @Query("SELECT notification FROM NotificationEntity notification JOIN notification.notificationMessages notificationMessage WHERE notificationMessage.id = :id") + @Query("SELECT notification FROM NotificationEntity notification JOIN notification.messages notificationMessage WHERE notificationMessage.id = :id") Optional findByNotificationMessageId(@Param("id") String id); List findAllByStatusIn(List statuses); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java index 2fc855855e..c0af54c786 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java @@ -45,7 +45,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; -import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Component; import java.time.Clock; import java.time.LocalDateTime; @@ -59,8 +59,8 @@ @Slf4j @RequiredArgsConstructor -@Repository @Transactional +@Component public class NotificationRepositoryImpl implements NotificationRepository { private final JpaNotificationRepository jpaNotificationRepository; @@ -104,17 +104,16 @@ public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNot public QualityNotificationId saveQualityNotificationEntity(QualityNotification notification) { List assetEntities = getAssetEntitiesByNotification(notification); - if (!assetEntities.isEmpty()) { - NotificationEntity notificationEntity = NotificationEntity.from(notification, assetEntities); + if (assetEntities.isEmpty()) { + throw new IllegalArgumentException("No assets found for %s asset ids".formatted(String.join(", ", notification.getAssetIds()))); + } + NotificationEntity notificationEntity = NotificationEntity.from(notification, assetEntities); - jpaNotificationRepository.save(notificationEntity); + jpaNotificationRepository.save(notificationEntity); - notification.getNotifications().forEach(notificationMessage -> handleNotificationCreate(notificationEntity, notificationMessage, assetEntities)); + notification.getNotifications().forEach(notificationMessage -> handleNotificationCreate(notificationEntity, notificationMessage, assetEntities)); - return new QualityNotificationId(notificationEntity.getId()); - } else { - throw new IllegalArgumentException("No assets found for %s asset ids".formatted(String.join(", ", notification.getAssetIds()))); - } + return new QualityNotificationId(notificationEntity.getId()); } @Override @@ -141,6 +140,7 @@ public PageResult getNotifications(Pageable pageable, Searc return new PageResult<>(jpaNotificationRepository.findAll(specification, pageable), NotificationEntity::toDomain); } + @Transactional @Override public long countOpenNotificationsByOwnership(List owners) { return jpaNotificationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)) diff --git a/tx-backend/src/main/resources/db/migration/R__create_asset_as_built_view.sql b/tx-backend/src/main/resources/db/migration/R__create_asset_as_built_view.sql index 9aad7ef4bb..761ed14947 100644 --- a/tx-backend/src/main/resources/db/migration/R__create_asset_as_built_view.sql +++ b/tx-backend/src/main/resources/db/migration/R__create_asset_as_built_view.sql @@ -1,64 +1,68 @@ create or replace view assets_as_built_view as select asset.*, - (select count(alert.id) - from alert alert + (select count(notification.id) + from notification notification join - assets_as_built_alerts alert_assets - on alert.id = alert_assets.alert_id + assets_as_built_notifications notification_assets + on notification.id = notification_assets.notification_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' + cast(notification.status as text) = 'CREATED' + or cast(notification.status as text) = 'SENT' + or cast(notification.status as text) = 'RECEIVED' + or cast(notification.status as text) = 'ACKNOWLEDGED' + or cast(notification.status as text) = 'ACCEPTED' + or cast(notification.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 + and cast(notification.side as text) = 'RECEIVER' + and cast(notification.type as text) = 'ALERT' + and notification_assets.asset_id = asset.id) as received_active_alerts, + (select count(notification.id) + from notification notification join - assets_as_built_alerts alert_assets - on alert.id = alert_assets.alert_id + assets_as_built_notifications notification_assets + on notification.id = notification_assets.notification_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' + cast(notification.status as text) = 'CREATED' + or cast(notification.status as text) = 'SENT' + or cast(notification.status as text) = 'RECEIVED' + or cast(notification.status as text) = 'ACKNOWLEDGED' + or cast(notification.status as text) = 'ACCEPTED' + or cast(notification.status as text) = 'DECLINED' ) - and cast(alert.side as text) = 'SENDER' - and alert_assets.asset_id = asset.id) as sent_active_alerts, - (select count(investigation.id) - from investigation investigation + and cast(notification.side as text) = 'SENDER' + and cast(notification.type as text) = 'ALERT' + and notification_assets.asset_id = asset.id) as sent_active_alerts, + (select count(notification.id) + from notification notification join - assets_as_built_investigations investigation_assets - on investigation.id = investigation_assets.investigation_id + assets_as_built_notifications notification_assets + on notification.id = notification_assets.notification_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' + cast(notification.status as text) = 'CREATED' + or cast(notification.status as text) = 'SENT' + or cast(notification.status as text) = 'RECEIVED' + or cast(notification.status as text) = 'ACKNOWLEDGED' + or cast(notification.status as text) = 'ACCEPTED' + or cast(notification.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 + and cast(notification.side as text) = 'RECEIVER' + and cast(notification.type as text) = 'INVESTIGATION' + and notification_assets.asset_id = asset.id) as received_active_investigations, + (select count(notification.id) + from notification notification join - assets_as_built_investigations investigation_assets - on investigation.id = investigation_assets.investigation_id + assets_as_built_notifications notification_assets + on notification.id = notification_assets.notification_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' + cast(notification.status as text) = 'CREATED' + or cast(notification.status as text) = 'SENT' + or cast(notification.status as text) = 'RECEIVED' + or cast(notification.status as text) = 'ACKNOWLEDGED' + or cast(notification.status as text) = 'ACCEPTED' + or cast(notification.status as text) = 'DECLINED' ) - and cast(investigation.side as text) = 'SENDER' - and investigation_assets.asset_id = asset.id) as sent_active_investigations + and cast(notification.side as text) = 'SENDER' + and cast(notification.type as text) = 'INVESTIGATION' + and notification_assets.asset_id = asset.id) as sent_active_investigations from assets_as_built as asset; diff --git a/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql index e31926299b..d9ead71f28 100644 --- a/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql +++ b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql @@ -1,6 +1,18 @@ DROP VIEW IF EXISTS assets_as_built_view; + +DROP TABLE public.asset_as_built_alert_notifications; DROP TABLE public.assets_as_built_notifications; +DROP TABLE public.investigation_notification; +DROP TABLE public.assets_as_built_investigations; +DROP TABLE public.alert_notification; +DROP TABLE public.assets_as_built_alerts; +DROP TABLE public.alert; +DROP TABLE public.investigation; +DROP SEQUENCE public.alert_id_seq; +DROP SEQUENCE public.investigation_id_seq; + + -- DROP TABLE notification; CREATE TABLE public.notification ( @@ -14,7 +26,6 @@ CREATE TABLE public.notification side varchar(50) NULL, accept_reason varchar(1000) NULL, decline_reason varchar(1000) NULL, - error_message varchar(255) NULL, type varchar(50) NULL, CONSTRAINT notification_pk PRIMARY KEY (id) ); @@ -29,13 +40,14 @@ CREATE TABLE public.notification_message created_by varchar(255) NULL, notification_id int8 NULL, target_date timestamp NULL, - severity int4 NULL, + severity varchar(255) NULL, created_by_name varchar(255) NULL, send_to_name varchar(255) NULL, edc_notification_id varchar(255) NULL, status varchar(255) NULL, created timestamptz NULL, updated timestamptz NULL, + error_message varchar NULL, message_id varchar(255) NULL, is_initial bool NULL, CONSTRAINT notification_message_pkey PRIMARY KEY (id), @@ -65,7 +77,7 @@ CREATE TABLE public.assets_as_built_notifications CREATE TABLE public.assets_as_built_notification_messages ( - notification_id varchar(255) NOT NULL, + notification_message_id varchar(255) NOT NULL, asset_id varchar(255) NOT NULL, - CONSTRAINT fk_notification FOREIGN KEY (notification_id) REFERENCES public.notification_message (id) + CONSTRAINT fk_notification FOREIGN KEY (notification_message_id) REFERENCES public.notification_message (id) ); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMapperTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMapperTest.java index 646b519e50..0f532c0555 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMapperTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/NotificationMapperTest.java @@ -22,6 +22,7 @@ import org.eclipse.tractusx.traceability.bpn.domain.service.BpnRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationContent; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationHeader; @@ -64,7 +65,7 @@ void testToReceiverNotification() { when(bpnRepository.findManufacturerName(eq(expectedNotification.getSendTo()))).thenReturn(expectedNotification.getSendToName()); - QualityNotificationMessage actualNotification = notificationMapper.toNotification(edcNotification); + QualityNotificationMessage actualNotification = notificationMapper.toNotification(edcNotification, QualityNotificationType.INVESTIGATION); assertNotNull(actualNotification.getId()); assertEquals(expectedNotification.getNotificationReferenceId(), actualNotification.getNotificationReferenceId()); assertEquals(expectedNotification.getCreatedBy(), actualNotification.getCreatedBy()); @@ -76,5 +77,6 @@ void testToReceiverNotification() { assertEquals(expectedNotification.getNotificationStatus(), actualNotification.getNotificationStatus()); assertEquals(expectedNotification.getAffectedParts(), actualNotification.getAffectedParts()); assertEquals(expectedNotification.getSeverity(), actualNotification.getSeverity()); + assertEquals(expectedNotification.getType(), actualNotification.getType()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java index 1945afc50d..ea625aaafe 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -60,10 +61,11 @@ void testToReceiverInvestigation() { .severity(QualityNotificationSeverity.MINOR) .messageId("1") .build(); + QualityNotificationType type = QualityNotificationType.INVESTIGATION; // When - QualityNotification result = mapper.toQualityNotification(new BPN(receiver), description, notification); + QualityNotification result = mapper.toQualityNotification(new BPN(receiver), description, notification, type); // Then assertEquals(QualityNotificationStatus.RECEIVED, result.getNotificationStatus()); @@ -71,6 +73,7 @@ void testToReceiverInvestigation() { assertEquals(description, result.getDescription()); assertEquals(List.of("123"), result.getAssetIds()); assertEquals(List.of(notification), result.getNotifications()); + assertEquals(result.getNotificationType(), QualityNotificationType.INVESTIGATION); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java index a57b171b1b..823c59b8ec 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java @@ -28,6 +28,7 @@ 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.integration.common.support.NotificationSupport; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -38,6 +39,7 @@ import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.QualityNotificationTypeRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import java.util.List; @@ -58,14 +60,11 @@ class DashboardControllerIT extends IntegrationTestSpecification { AssetsSupport assetsSupport; @Autowired - InvestigationsSupport investigationsSupport; + NotificationSupport notificationSupport; @Autowired JpaAssetAsBuiltRepository assetAsBuiltRepository; - @Autowired - AlertsSupport alertsSupport; - ObjectMapper objectMapper; @BeforeEach @@ -116,8 +115,8 @@ void givenAlertsWithAssets_whenGetDashboard_thenReturnResponse() throws JoseExce List supplierAssets = assets.stream() .filter(asset -> asset.getOwner().equals(Owner.SUPPLIER)) .toList(); - alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets); - alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets); + notificationSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets); + notificationSupport.storeAlertWithStatusAndAssets(SENT, ownAssets); // when/then given() @@ -162,12 +161,13 @@ void givenNoRoles_whenGetDashboard_thenReturn401() throws JoseException { void givenPendingInvestigation_whenGetDashboard_thenReturnPendingInvestigation() throws JoseException, JsonProcessingException { // given assetsSupport.defaultAssetsStored(); - investigationsSupport.defaultReceivedInvestigationStored(); + notificationSupport.defaultReceivedInvestigationStored(); String assetId = "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"; var notificationRequest = StartQualityNotificationRequest.builder() .partIds(List.of(assetId)) .description("at least 15 characters long investigation description") .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.INVESTIGATION) .isAsBuilt(true) .build(); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java index 6dd286caaa..a97e7f0ba8 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java @@ -25,6 +25,11 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertNotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -45,23 +50,23 @@ public class AlertNotificationsSupport { private static final String OTHER_BPN_COMPANY_NAME = "Parts Company"; @Autowired - JpaAlertNotificationRepository jpaAlertNotificationRepository; + JpaNotificationMessageRepository jpaNotificationMessageRepository; public void defaultAlertsStored() { storeCreatedAlerts(); storeReceivedAlerts(); } - public AlertNotificationEntity storedAlertNotification(AlertNotificationEntity notification) { - return jpaAlertNotificationRepository.save(notification); + public NotificationMessageEntity storedAlertNotification(NotificationMessageEntity notification) { + return jpaNotificationMessageRepository.save(notification); } - public void storedAlertNotifications(AlertNotificationEntity... notifications) { + public void storedAlertNotifications(NotificationMessageEntity... notifications) { Arrays.stream(notifications).forEach(this::storedAlertNotification); } public void assertAlertNotificationsSize(int size) { - List notifications = jpaAlertNotificationRepository.findAll(); + List notifications = jpaNotificationMessageRepository.findAll(); assertThat(notifications).hasSize(size); } @@ -70,86 +75,94 @@ private void storeCreatedAlerts() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); Instant monthFromNow = Instant.parse("2023-11-10T10:10:10.00Z"); - AlertEntity alert1 = AlertEntity.builder() + NotificationEntity alert1 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CREATED) .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .description("1") .createdDate(now.minus(3L, DAYS)) .build(); - AlertEntity alert2 = AlertEntity.builder() + NotificationEntity alert2 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.SENT) .description("2") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.minus(2L, DAYS)) .updated(now.minus(2L, DAYS)) .build(); - AlertEntity alert3 = AlertEntity.builder() + NotificationEntity alert3 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .description("3") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.minus(1L, DAYS)) .updated(now.minus(1L, DAYS)) .build(); - AlertEntity alert4 = AlertEntity.builder() + NotificationEntity alert4 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .description("4") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now) .updated(now) .build(); - AlertEntity alert5 = AlertEntity.builder() + NotificationEntity alert5 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .acceptReason("Almighty demon king accepted this one") .description("5") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now) .updated(now) .build(); - AlertEntity alert6 = AlertEntity.builder() + NotificationEntity alert6 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.DECLINED) .declineReason("Almighty demon king has declined this one") .description("6") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plus(1L, DAYS)) .updated(now.plus(1L, DAYS)) .build(); - AlertEntity alert7 = AlertEntity.builder() + NotificationEntity alert7 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CANCELED) .description("7") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plus(2L, DAYS)) .updated(now.plus(2L, DAYS)) .build(); - AlertEntity alert8 = AlertEntity.builder() + NotificationEntity alert8 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CLOSED) .description("8") .closeReason("Almighty demon king has closed that one") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plus(3L, DAYS)) .updated(now.plus(3L, DAYS)) .build(); storedAlertNotifications( - AlertNotificationEntity + NotificationMessageEntity .builder() .id("1") - .alert(alert1) + .notification(alert1) .status(NotificationStatusBaseEntity.CREATED) .sendTo(OTHER_BPN) .createdBy(OWN_BPN) @@ -158,7 +171,7 @@ private void storeCreatedAlerts() { .createdByName(OWN_BPN_COMPANY_NAME) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a1") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .sendTo(OTHER_BPN) .createdBy(OWN_BPN) @@ -167,10 +180,10 @@ private void storeCreatedAlerts() { .severity(QualityNotificationSeverity.MAJOR) .id("2") .targetDate(monthFromNow.minus(2L, DAYS)) - .alert(alert2) + .notification(alert2) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a2") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.RECEIVED) .id("3") @@ -179,10 +192,10 @@ private void storeCreatedAlerts() { .severity(QualityNotificationSeverity.CRITICAL) .targetDate(monthFromNow.minus(1L, DAYS)) .createdByName(OTHER_BPN_COMPANY_NAME) - .alert(alert3) + .notification(alert3) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a3") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .id("4") @@ -190,10 +203,10 @@ private void storeCreatedAlerts() { .severity(QualityNotificationSeverity.LIFE_THREATENING) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .alert(alert4) + .notification(alert4) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a4") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.ACCEPTED) .id("5") @@ -201,10 +214,10 @@ private void storeCreatedAlerts() { .severity(QualityNotificationSeverity.MINOR) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .alert(alert5) + .notification(alert5) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a5") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.DECLINED) .id("6") @@ -212,10 +225,10 @@ private void storeCreatedAlerts() { .targetDate(monthFromNow.plus(1L, DAYS)) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .alert(alert6) + .notification(alert6) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a6") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.CANCELED) .id("7") @@ -223,10 +236,10 @@ private void storeCreatedAlerts() { .severity(QualityNotificationSeverity.CRITICAL) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) - .alert(alert7) + .notification(alert7) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a7") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.CLOSED) .id("8") @@ -234,7 +247,7 @@ private void storeCreatedAlerts() { .targetDate(monthFromNow.plus(3L, DAYS)) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) - .alert(alert8) + .notification(alert8) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a8") .build() ); @@ -243,100 +256,106 @@ private void storeCreatedAlerts() { private void storeReceivedAlerts() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); - AlertEntity alert1 = AlertEntity.builder() + NotificationEntity alert1 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .description("11") .createdDate(now.minus(2L, DAYS)) .build(); - AlertEntity alert2 = AlertEntity.builder() + NotificationEntity alert2 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .description("22") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.minus(1L, DAYS)) .build(); - AlertEntity alert3 = AlertEntity.builder() + NotificationEntity alert3 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .description("33") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now) .build(); - AlertEntity alert4 = AlertEntity.builder() + NotificationEntity alert4 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.DECLINED) .description("44") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plusSeconds(20L)) .build(); - AlertEntity alert5 = AlertEntity.builder() + NotificationEntity alert5 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.CANCELED) .description("55") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plusSeconds(1L)) .build(); - AlertEntity alert6 = AlertEntity.builder() + NotificationEntity alert6 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OTHER_BPN) .status(NotificationStatusBaseEntity.CLOSED) .description("55") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.plus(2L, DAYS)) .build(); storedAlertNotifications( - AlertNotificationEntity + NotificationMessageEntity .builder() .id("11") - .alert(alert1) + .notification(alert1) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a11") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .id("22") - .alert(alert2) + .notification(alert2) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a22") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .id("33") - .alert(alert3) + .notification(alert3) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a33") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .id("44") - .alert(alert4) + .notification(alert4) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.DECLINED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a44") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .id("55") - .alert(alert5) + .notification(alert5) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CANCELED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a55") .build(), - AlertNotificationEntity + NotificationMessageEntity .builder() .id("66") - .alert(alert6) + .notification(alert6) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CLOSED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a66") @@ -344,29 +363,30 @@ private void storeReceivedAlerts() { ); } - public AlertNotificationEntity storeAlertNotification() { + public NotificationMessageEntity storeAlertNotification() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); - AlertEntity alert = AlertEntity.builder() + NotificationEntity alert = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.SENT) .description("2") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.ALERT) .createdDate(now.minus(2L, DAYS)) .updated(now.minus(2L, DAYS)) .build(); - AlertNotificationEntity notificationEntity = AlertNotificationEntity + NotificationMessageEntity notificationEntity = NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.SENT) .id("1") .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) .sendTo(OTHER_BPN) - .alert(alert) + .notification(alert) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a1") .build(); storedAlertNotifications(notificationEntity); - return jpaAlertNotificationRepository.findById(notificationEntity.getId()).get(); + return jpaNotificationMessageRepository.findById(notificationEntity.getId()).get(); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java index 5a657c1cf3..51dec8eb3d 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java @@ -21,12 +21,13 @@ 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.asplanned.model.AssetAsPlannedEntity; 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.alert.repository.JpaAlertRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -41,17 +42,18 @@ public class AlertsSupport { @Autowired - JpaAlertRepository jpaAlertRepository; + JpaNotificationRepository jpaNotificationRepository; @Autowired JpaAssetAsBuiltRepository jpaAssetAsBuiltRepository; public Long defaultReceivedAlertStored() { - AlertEntity entity = AlertEntity.builder() + NotificationEntity entity = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(NotificationStatusBaseEntity.RECEIVED) .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .description("some description") .createdDate(Instant.now()) .build(); @@ -64,41 +66,42 @@ public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, L } public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, NotificationSideBaseEntity side) { - AlertEntity entity = AlertEntity.builder() + NotificationEntity entity = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(status) .side(side) + .type(NotificationTypeEntity.ALERT) .createdDate(Instant.now()) .build(); Long alertId = storedAlert(entity); - AlertEntity savedAlert = jpaAlertRepository.findById(alertId).get(); + NotificationEntity savedAlert = jpaNotificationRepository.findById(alertId).get(); savedAlert.setAssets(assetsAsBuilt); - jpaAlertRepository.save(savedAlert); + jpaNotificationRepository.save(savedAlert); return alertId; } public void assertAlertsSize(int size) { - List alerts = jpaAlertRepository.findAll(); + List alerts = jpaNotificationRepository.findAll(); assert alerts.size() == size; } public void assertAlertStatus(QualityNotificationStatus alertStatus) { - jpaAlertRepository.findAll().forEach(alert -> + jpaNotificationRepository.findAll().forEach(alert -> assertThat(alert.getStatus().name()).isEqualTo(alertStatus.name()) ); } - void storedAlerts(AlertEntity... alerts) { - jpaAlertRepository.saveAll(Arrays.asList(alerts)); + void storedAlerts(NotificationEntity... alerts) { + jpaNotificationRepository.saveAll(Arrays.asList(alerts)); } - public Long storedAlert(AlertEntity alert) { - return jpaAlertRepository.save(alert).getId(); + public Long storedAlert(NotificationEntity alert) { + return jpaNotificationRepository.save(alert).getId(); } - public AlertEntity storedAlertFullObject(AlertEntity alert) { - return jpaAlertRepository.save(alert); + public NotificationEntity storedAlertFullObject(NotificationEntity alert) { + return jpaNotificationRepository.save(alert); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DatabaseSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DatabaseSupport.java index 8b96e0dc05..15696c257c 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DatabaseSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DatabaseSupport.java @@ -27,24 +27,23 @@ @Component public class DatabaseSupport { + // TODO: CLEAR NEW TABLES private static final List TABLES = List.of(new String[]{ "submodel_payload", "import_job_assets_as_built", "import_job_assets_as_planned", "assets_as_built_childs", "assets_as_built_parents", - "assets_as_built_notifications", - "assets_as_built_investigations", - "asset_as_built_alert_notifications", - "assets_as_built_alerts", "assets_as_planned_childs", - "alert_notification", - "alert", + "assets_as_planned_notifications", + "assets_as_planned_notification_messages", + "assets_as_built_notifications", + "assets_as_built_notification_messages", + "notification_message", + "notification", "assets_as_built", "assets_as_planned", "bpn_storage", - "investigation_notification", - "investigation", "traction_battery_code_subcomponent", "import_job" }); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java index 75d6799a69..5af001b5bc 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java @@ -23,9 +23,12 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository.JpaInvestigationNotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -46,7 +49,7 @@ public class InvestigationNotificationsSupport { private static final String OTHER_BPN_COMPANY_NAME = "Parts Company"; @Autowired - JpaInvestigationNotificationRepository jpaInvestigationNotificationRepository; + JpaNotificationMessageRepository jpaNotificationMessageRepository; @Autowired JpaAssetAsBuiltRepository jpaAssetAsBuiltRepository; @@ -56,18 +59,18 @@ public void defaultInvestigationsStored() { storeReceivedInvestigations(); } - public InvestigationNotificationEntity storedNotification(InvestigationNotificationEntity notification) { - return jpaInvestigationNotificationRepository.save(notification); + public NotificationMessageEntity storedNotification(NotificationMessageEntity notification) { + return jpaNotificationMessageRepository.save(notification); } - public void storedNotifications(InvestigationNotificationEntity... notifications) { + public void storedNotifications(NotificationMessageEntity... notifications) { Arrays.stream(notifications) .forEach(this::storedNotification); } public void assertNotificationsSize(int size) { - List notifications = jpaInvestigationNotificationRepository.findAll(); + List notifications = jpaNotificationMessageRepository.findAll(); assertThat(notifications).hasSize(size); } @@ -76,86 +79,94 @@ private void storeCreatedInvestigations() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); Instant monthFromNow = Instant.parse("2023-11-10T10:10:10.00Z"); - InvestigationEntity investigation1 = InvestigationEntity.builder() + NotificationEntity investigation1 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CREATED) .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .description("1") .createdDate(now.minus(3L, DAYS)) .build(); - InvestigationEntity investigation2 = InvestigationEntity.builder() + NotificationEntity investigation2 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.SENT) .description("2") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.minus(2L, DAYS)) .updated(now.minus(2L, DAYS)) .build(); - InvestigationEntity investigation3 = InvestigationEntity.builder() + NotificationEntity investigation3 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .description("3") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.minus(1L, DAYS)) .updated(now.minus(1L, DAYS)) .build(); - InvestigationEntity investigation4 = InvestigationEntity.builder() + NotificationEntity investigation4 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .description("4") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now) .updated(now) .build(); - InvestigationEntity investigation5 = InvestigationEntity.builder() + NotificationEntity investigation5 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .acceptReason("Almighty demon king accepted this one") .description("5") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now) .updated(now) .build(); - InvestigationEntity investigation6 = InvestigationEntity.builder() + NotificationEntity investigation6 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.DECLINED) .declineReason("Almighty demon king has declined this one") .description("6") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plus(1L, DAYS)) .updated(now.plus(1L, DAYS)) .build(); - InvestigationEntity investigation7 = InvestigationEntity.builder() + NotificationEntity investigation7 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CANCELED) .description("7") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plus(2L, DAYS)) .updated(now.plus(2L, DAYS)) .build(); - InvestigationEntity investigation8 = InvestigationEntity.builder() + NotificationEntity investigation8 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.CLOSED) .description("8") .closeReason("Almighty demon king has closed that one") .side(NotificationSideBaseEntity.SENDER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plus(3L, DAYS)) .updated(now.plus(3L, DAYS)) .build(); storedNotifications( - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("1") - .investigation(investigation1) + .notification(investigation1) .status(NotificationStatusBaseEntity.CREATED) .severity(QualityNotificationSeverity.MINOR) .sendTo(OTHER_BPN) @@ -164,7 +175,7 @@ private void storeCreatedInvestigations() { .createdByName(OWN_BPN_COMPANY_NAME) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a1") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .sendTo(OTHER_BPN) .createdBy(OWN_BPN) @@ -173,10 +184,10 @@ private void storeCreatedInvestigations() { .severity(QualityNotificationSeverity.MAJOR) .id("2") .targetDate(monthFromNow.minus(2L, DAYS)) - .investigation(investigation2) + .notification(investigation2) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a2") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.RECEIVED) .id("3") @@ -185,10 +196,10 @@ private void storeCreatedInvestigations() { .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .investigation(investigation3) + .notification(investigation3) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a3") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .id("4") @@ -197,10 +208,10 @@ private void storeCreatedInvestigations() { .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .investigation(investigation4) + .notification(investigation4) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a4") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.ACCEPTED) .severity(QualityNotificationSeverity.MINOR) @@ -209,10 +220,10 @@ private void storeCreatedInvestigations() { .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .investigation(investigation5) + .notification(investigation5) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a5") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.DECLINED) .severity(QualityNotificationSeverity.MAJOR) @@ -221,10 +232,10 @@ private void storeCreatedInvestigations() { .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) - .investigation(investigation6) + .notification(investigation6) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a6") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.CANCELED) .id("7") @@ -233,10 +244,10 @@ private void storeCreatedInvestigations() { .targetDate(monthFromNow.plus(2L, DAYS)) .severity(QualityNotificationSeverity.CRITICAL) .createdByName(OWN_BPN_COMPANY_NAME) - .investigation(investigation7) + .notification(investigation7) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a7") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.CLOSED) .severity(QualityNotificationSeverity.LIFE_THREATENING) @@ -245,7 +256,7 @@ private void storeCreatedInvestigations() { .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) - .investigation(investigation8) + .notification(investigation8) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a8") .build() ); @@ -255,99 +266,105 @@ private void storeReceivedInvestigations() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); String otherBPN = "BPNL00000002OTHER"; - InvestigationEntity investigation1 = InvestigationEntity.builder() + NotificationEntity investigation1 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.RECEIVED) .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.INVESTIGATION) .description("11") .createdDate(now.minus(2L, DAYS)) .build(); - InvestigationEntity investigation2 = InvestigationEntity.builder() + NotificationEntity investigation2 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) + .type(NotificationTypeEntity.INVESTIGATION) .description("22") .side(NotificationSideBaseEntity.RECEIVER) .createdDate(now.minus(1L, DAYS)) .build(); - InvestigationEntity investigation3 = InvestigationEntity.builder() + NotificationEntity investigation3 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.ACCEPTED) .description("33") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now) .build(); - InvestigationEntity investigation4 = InvestigationEntity.builder() + NotificationEntity investigation4 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.DECLINED) .description("44") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plusSeconds(20L)) .build(); - InvestigationEntity investigation5 = InvestigationEntity.builder() + NotificationEntity investigation5 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.CANCELED) .description("55") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plus(1L, DAYS)) .build(); - InvestigationEntity investigation6 = InvestigationEntity.builder() + NotificationEntity investigation6 = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(otherBPN) .status(NotificationStatusBaseEntity.CLOSED) .description("55") .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.INVESTIGATION) .createdDate(now.plus(2L, DAYS)) .build(); storedNotifications( - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("11") - .investigation(investigation1) + .notification(investigation1) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a11") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("22") - .investigation(investigation2) + .notification(investigation2) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a22") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("33") - .investigation(investigation3) + .notification(investigation3) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a33") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("44") - .investigation(investigation4) + .notification(investigation4) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.DECLINED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a44") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("55") - .investigation(investigation5) + .notification(investigation5) .status(NotificationStatusBaseEntity.CANCELED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a55") .build(), - InvestigationNotificationEntity + NotificationMessageEntity .builder() .id("66") - .investigation(investigation6) + .notification(investigation6) .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CLOSED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a66") @@ -355,19 +372,20 @@ private void storeReceivedInvestigations() { ); } - public InvestigationNotificationEntity storeInvestigationNotification() { + public NotificationMessageEntity storeInvestigationNotification() { Instant now = Instant.parse("2023-10-10T10:10:10.00Z"); - InvestigationEntity investigation = InvestigationEntity.builder() + NotificationEntity investigation = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(OWN_BPN) .status(NotificationStatusBaseEntity.SENT) .description("2") + .type(NotificationTypeEntity.INVESTIGATION) .side(NotificationSideBaseEntity.SENDER) .createdDate(now.minus(2L, DAYS)) .updated(now.minus(2L, DAYS)) .build(); - InvestigationNotificationEntity notificationEntity = InvestigationNotificationEntity + NotificationMessageEntity notificationEntity = NotificationMessageEntity .builder() .status(NotificationStatusBaseEntity.SENT) .id("1") @@ -375,10 +393,10 @@ public InvestigationNotificationEntity storeInvestigationNotification() { .createdByName(OWN_BPN_COMPANY_NAME) .sendTo(OTHER_BPN) .sendToName(OTHER_BPN_COMPANY_NAME) - .investigation(investigation) + .notification(investigation) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a1") .build(); storedNotifications(notificationEntity); - return jpaInvestigationNotificationRepository.findById(notificationEntity.getId()).get(); + return jpaNotificationMessageRepository.findById(notificationEntity.getId()).get(); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java index d3af1f2d9a..d2b74698ab 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java @@ -26,6 +26,9 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository.JpaInvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -39,42 +42,30 @@ public class InvestigationsSupport { @Autowired - JpaInvestigationRepository jpaInvestigationRepository; - - public Long defaultReceivedInvestigationStored() { - InvestigationEntity entity = InvestigationEntity.builder() - .assets(Collections.emptyList()) - .bpn("BPNL00000003AXS3") - .status(NotificationStatusBaseEntity.RECEIVED) - .side(NotificationSideBaseEntity.RECEIVER) - .description("some description") - .createdDate(Instant.now()) - .build(); - - return jpaInvestigationRepository.save(entity).getId(); - } + JpaNotificationRepository jpaInvestigationRepository; public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt) { return storeInvestigationWithStatusAndAssets(status, assetsAsBuilt, NotificationSideBaseEntity.RECEIVER); } public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, NotificationSideBaseEntity side) { - InvestigationEntity entity = InvestigationEntity.builder() + NotificationEntity entity = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(status) + .type(NotificationTypeEntity.INVESTIGATION) .side(side) .createdDate(Instant.now()) .build(); Long alertId = storedInvestigation(entity); - InvestigationEntity savedInvestigation = jpaInvestigationRepository.findById(alertId).get(); + NotificationEntity savedInvestigation = jpaInvestigationRepository.findById(alertId).get(); savedInvestigation.setAssets(assetsAsBuilt); jpaInvestigationRepository.save(savedInvestigation); return alertId; } public void assertInvestigationsSize(int size) { - List investigations = jpaInvestigationRepository.findAll(); + List investigations = jpaInvestigationRepository.findAll(); assertThat(investigations).hasSize(size); } @@ -85,15 +76,15 @@ public void assertInvestigationStatus(QualityNotificationStatus investigationSta ); } - public Long storedInvestigation(InvestigationEntity investigation) { + public Long storedInvestigation(NotificationEntity investigation) { return jpaInvestigationRepository.save(investigation).getId(); } - public InvestigationEntity storedInvestigationFullObject(InvestigationEntity investigation) { + public NotificationEntity storedInvestigationFullObject(NotificationEntity investigation) { return jpaInvestigationRepository.save(investigation); } - public List findAllInvestigations() { + public List findAllInvestigations() { return jpaInvestigationRepository.findAll(); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java new file mode 100644 index 0000000000..d40e2db060 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java @@ -0,0 +1,41 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.integration.common.support; + +import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; +import org.springframework.stereotype.Component; + +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +@Component +@RequiredArgsConstructor +public class NotificationMessageSupport { + + private final JpaNotificationMessageRepository jpaNotificationMessageRepository; + public void assertNotificationsSize(int size) { + List notifications = jpaNotificationMessageRepository.findAll(); + assertThat(notifications).hasSize(size); + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java new file mode 100644 index 0000000000..1babdf2200 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java @@ -0,0 +1,96 @@ +/******************************************************************************** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.integration.common.support; + +import lombok.RequiredArgsConstructor; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; +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.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.Instant; +import java.util.Collections; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +@Component +@RequiredArgsConstructor +public class NotificationSupport { + + private final JpaNotificationRepository jpaNotificationRepository; + + public Long defaultReceivedInvestigationStored() { + NotificationEntity entity = NotificationEntity.builder() + .assets(Collections.emptyList()) + .bpn("BPNL00000003AXS3") + .type(NotificationTypeEntity.INVESTIGATION) + .status(NotificationStatusBaseEntity.RECEIVED) + .side(NotificationSideBaseEntity.RECEIVER) + .description("some description") + .createdDate(Instant.now()) + .build(); + + return jpaNotificationRepository.save(entity).getId(); + } + + public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt) { + return storeAlertWithStatusAndAssets(status, assetsAsBuilt, NotificationSideBaseEntity.RECEIVER); + } + + public Long storeAlertWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt, NotificationSideBaseEntity side) { + NotificationEntity entity = NotificationEntity.builder() + .assets(Collections.emptyList()) + .bpn("BPNL00000003AXS3") + .status(status) + .side(side) + .type(NotificationTypeEntity.ALERT) + .createdDate(Instant.now()) + .build(); + Long alertId = storedAlert(entity); + NotificationEntity savedAlert = jpaNotificationRepository.findById(alertId).get(); + savedAlert.setAssets(assetsAsBuilt); + jpaNotificationRepository.save(savedAlert); + return alertId; + } + + public Long storedAlert(NotificationEntity alert) { + return jpaNotificationRepository.save(alert).getId(); + } + + public void assertInvestigationsSize(int size) { + List investigations = jpaNotificationRepository.findAll(); + + assertThat(investigations).hasSize(size); + } + + public void assertInvestigationStatus(QualityNotificationStatus investigationStatus) { + jpaNotificationRepository.findAll().forEach( + investigation -> assertThat(investigation.getStatus().name()).isEqualTo(investigationStatus.name()) + ); + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java index 245c4407ad..37e47299d4 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java @@ -36,6 +36,9 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -117,7 +120,7 @@ void shouldAddANotificationToExistingInvestigationOnAPICallback() throws IOExcep AssetAsBuiltEntity assetAsBuiltEntity = assetsSupport.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb"); - InvestigationNotificationEntity notification = InvestigationNotificationEntity + NotificationMessageEntity notification = NotificationMessageEntity .builder() .id("1") .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a") @@ -125,7 +128,7 @@ void shouldAddANotificationToExistingInvestigationOnAPICallback() throws IOExcep .assets(List.of(assetAsBuiltEntity)) .build(); - InvestigationNotificationEntity notificationSent = InvestigationNotificationEntity + NotificationMessageEntity notificationSent = NotificationMessageEntity .builder() .id("2") .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a") @@ -133,28 +136,29 @@ void shouldAddANotificationToExistingInvestigationOnAPICallback() throws IOExcep .assets(List.of(assetAsBuiltEntity)) .build(); - InvestigationEntity investigation = InvestigationEntity.builder() + NotificationEntity investigation = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(NotificationStatusBaseEntity.SENT) + .type(NotificationTypeEntity.INVESTIGATION) .side(NotificationSideBaseEntity.SENDER) .createdDate(Instant.now()) .build(); - InvestigationEntity persistedInvestigation = investigationsSupport.storedInvestigationFullObject(investigation); + NotificationEntity persistedInvestigation = investigationsSupport.storedInvestigationFullObject(investigation); - InvestigationNotificationEntity notificationEntity = investigationNotificationsSupport.storedNotification(notification); - notificationEntity.setInvestigation(persistedInvestigation); + NotificationMessageEntity notificationEntity = investigationNotificationsSupport.storedNotification(notification); + notificationEntity.setNotification(persistedInvestigation); - InvestigationNotificationEntity notificationEntitySent = investigationNotificationsSupport.storedNotification(notificationSent); - notificationEntitySent.setInvestigation(persistedInvestigation); + NotificationMessageEntity notificationEntitySent = investigationNotificationsSupport.storedNotification(notificationSent); + notificationEntitySent.setNotification(persistedInvestigation); - InvestigationNotificationEntity persistedNotification = investigationNotificationsSupport.storedNotification(notificationEntity); - InvestigationNotificationEntity persistedNotificationSent = investigationNotificationsSupport.storedNotification(notificationEntitySent); - List notificationEntities = new ArrayList<>(); + NotificationMessageEntity persistedNotification = investigationNotificationsSupport.storedNotification(notificationEntity); + NotificationMessageEntity persistedNotificationSent = investigationNotificationsSupport.storedNotification(notificationEntitySent); + List notificationEntities = new ArrayList<>(); notificationEntities.add(persistedNotificationSent); notificationEntities.add(persistedNotification); - investigation.setNotifications(notificationEntities); + investigation.setMessages(notificationEntities); investigationsSupport.storedInvestigationFullObject(investigation); @@ -182,28 +186,29 @@ void shouldAddANotificationToExistingInvestigationOnAPICallback() throws IOExcep void shouldThrowBadRequestBecauseEdcNotificationMethodIsNotSupported() throws IOException, JoseException { // given assetsSupport.defaultAssetsStored(); - InvestigationNotificationEntity notification = InvestigationNotificationEntity + NotificationMessageEntity notification = NotificationMessageEntity .builder() .id("1") .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a") .build(); - InvestigationEntity investigation = InvestigationEntity.builder() + NotificationEntity investigation = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(NotificationStatusBaseEntity.SENT) + .type(NotificationTypeEntity.INVESTIGATION) .side(NotificationSideBaseEntity.SENDER) .createdDate(Instant.now()) .build(); - InvestigationEntity persistedInvestigation = investigationsSupport.storedInvestigationFullObject(investigation); + NotificationEntity persistedInvestigation = investigationsSupport.storedInvestigationFullObject(investigation); - InvestigationNotificationEntity notificationEntity = investigationNotificationsSupport.storedNotification(notification); - notificationEntity.setInvestigation(persistedInvestigation); - InvestigationNotificationEntity persistedNotification = investigationNotificationsSupport.storedNotification(notificationEntity); + NotificationMessageEntity notificationEntity = investigationNotificationsSupport.storedNotification(notification); + notificationEntity.setNotification(persistedInvestigation); + NotificationMessageEntity persistedNotification = investigationNotificationsSupport.storedNotification(notificationEntity); - investigation.setNotifications(List.of(persistedNotification)); + investigation.setMessages(List.of(persistedNotification)); investigationsSupport.storedInvestigationFullObject(investigation); @@ -230,9 +235,10 @@ void shouldThrowBadRequestBecauseEdcNotificationMethodIsNotSupported() throws IO @Test void shouldCallUpdateApiWithWrongRequestObject() throws JoseException { // given - InvestigationEntity investigation = InvestigationEntity.builder() + NotificationEntity investigation = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") + .type(NotificationTypeEntity.INVESTIGATION) .status(NotificationStatusBaseEntity.RECEIVED) .side(NotificationSideBaseEntity.RECEIVER) .createdDate(Instant.now()) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java index e175a8fa25..5b5e9d5df4 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java @@ -26,8 +26,9 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -40,7 +41,7 @@ class AlertsRepositoryIT extends IntegrationTestSpecification { @Autowired - JpaAlertRepository jpaAlertRepository; + JpaNotificationRepository jpaNotificationRepository; @Autowired AlertsSupport alertsSupport; @@ -68,7 +69,7 @@ void givenAlertsWithAssets_whenCountDistinctAffectedSupplierPartsWithAlertReceiv alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); - assertThat(jpaAlertRepository.findAll()).hasSize(3); + assertThat(jpaNotificationRepository.findAll()).hasSize(3); // when Long result = repository.countPartsByStatusAndOwnership(List.of(QualityNotificationStatus.RECEIVED), Owner.SUPPLIER); @@ -91,7 +92,7 @@ void givenAlertsWithAssets_whenCountDistinctAffectedOwnPartsWithAlertSentStatus_ alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); - assertThat(jpaAlertRepository.findAll()).hasSize(3); + assertThat(jpaNotificationRepository.findAll()).hasSize(3); // when Long result = repository.countPartsByStatusAndOwnership(List.of(QualityNotificationStatus.SENT), Owner.OWN); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java index 197a63c0ac..046f59b61e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java @@ -51,6 +51,7 @@ import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.QualityNotificationTypeRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; @@ -89,7 +90,7 @@ void setUp() { void shouldReceiveAlert() { // given assetsSupport.defaultAssetsStored(); - + QualityNotificationType notificationType = QualityNotificationType.ALERT; QualityNotificationMessage notificationBuild = QualityNotificationMessage.builder() .id("some-id") .notificationStatus(QualityNotificationStatus.SENT) @@ -100,15 +101,16 @@ void shouldReceiveAlert() { .sendToName("Receiver manufacturer name") .severity(QualityNotificationSeverity.MINOR) .targetDate(Instant.parse("2018-11-30T18:35:24.00Z")) - .type(QualityNotificationType.ALERT) + .type(notificationType) .severity(QualityNotificationSeverity.MINOR) .messageId("messageId") .build(); EDCNotification notification = EDCNotificationFactory.createEdcNotification( "it", notificationBuild); + // when - alertsReceiverService.handleReceive(notification); + alertsReceiverService.handleReceive(notification, notificationType); // then alertsSupport.assertAlertsSize(1); @@ -134,6 +136,7 @@ void shouldStartAlert() throws JsonProcessingException, JoseException { .partIds(partIds) .description(description) .severity(severity) + .type(QualityNotificationTypeRequest.ALERT) .receiverBpn(receiverBpn) .isAsBuilt(true) .build(); @@ -285,6 +288,7 @@ void shouldCancelAlert() throws JsonProcessingException, JoseException { .partIds(List.of("urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978")) .description("at least 15 characters long investigation description") .severity(QualityNotificationSeverityRequest.MAJOR) + .type(QualityNotificationTypeRequest.ALERT) .receiverBpn("BPN") .isAsBuilt(true) .build(); @@ -350,6 +354,7 @@ void shouldApproveAlertStatus() throws JsonProcessingException, JoseException { .partIds(partIds) .description(description) .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.ALERT) .receiverBpn("BPN") .isAsBuilt(true) .build(); @@ -406,6 +411,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .partIds(partIds) .description(description) .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.ALERT) .receiverBpn("BPN") .isAsBuilt(true) .build(); @@ -488,7 +494,7 @@ void givenNonExistingAlert_whenCancel_thenReturnNotFound() throws JoseException .post("/api/alerts/1/cancel") .then() .statusCode(404) - .body("message", Matchers.is("Alert not found for 1 notification id")); + .body("message", Matchers.is("Notification with id: 1 not found")); } @Test @@ -518,6 +524,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .partIds(partIds) .description(description) .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.ALERT) .receiverBpn("BPN") .isAsBuilt(true) .build(); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java index a589ff7b23..1df2b0c390 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java @@ -31,6 +31,9 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; @@ -219,20 +222,21 @@ void shouldReturnProperlyPagedReceivedAlerts() throws JoseException { IntStream.range(101, 201) .forEach(number -> { - AlertEntity alertEntity = AlertEntity.builder() + NotificationEntity alertNotificationEntity = NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(testBpn) .status(NotificationStatusBaseEntity.CREATED) .side(NotificationSideBaseEntity.RECEIVER) + .type(NotificationTypeEntity.ALERT) .createdDate(now) .build(); - AlertEntity alert = alertsSupport.storedAlertFullObject(alertEntity); + NotificationEntity alert = alertsSupport.storedAlertFullObject(alertNotificationEntity); - AlertNotificationEntity notificationEntity = AlertNotificationEntity + NotificationMessageEntity notificationEntity = NotificationMessageEntity .builder() .id(UUID.randomUUID().toString()) - .alert(alert) + .notification(alert) .createdBy(senderBPN) .status(NotificationStatusBaseEntity.CREATED) .createdByName(senderName) @@ -241,8 +245,8 @@ void shouldReturnProperlyPagedReceivedAlerts() throws JoseException { .messageId("messageId") .build(); - AlertNotificationEntity persistedNotification = alertNotificationsSupport.storedAlertNotification(notificationEntity); - persistedNotification.setAlert(alert); + NotificationMessageEntity persistedNotification = alertNotificationsSupport.storedAlertNotification(notificationEntity); + persistedNotification.setNotification(alert); alertNotificationsSupport.storedAlertNotification(persistedNotification); } ); @@ -275,14 +279,14 @@ void givenNoAlertId_whenGetAlertById_thenReturnNotFound() throws JoseException { .get("/api/alerts/1234") .then() .statusCode(404) - .body("message", Matchers.is("Alert not found for 1234 notification id")); + .body("message", Matchers.is("Notification with id: 1234 not found")); } @Test void shouldReturnInvestigationById() throws JoseException { // given - AlertNotificationEntity storedAlertNotification = alertNotificationsSupport.storeAlertNotification(); - AlertEntity storedAlert = storedAlertNotification.getAlert(); + NotificationMessageEntity storedAlertNotification = alertNotificationsSupport.storeAlertNotification(); + NotificationEntity storedAlert = storedAlertNotification.getNotification(); // when/then given() diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java index eab2f879f7..3260face9e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java @@ -32,6 +32,8 @@ import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; +import org.eclipse.tractusx.traceability.integration.common.support.NotificationMessageSupport; +import org.eclipse.tractusx.traceability.integration.common.support.NotificationSupport; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; @@ -67,12 +69,14 @@ class PublisherInvestigationsControllerIT extends IntegrationTestSpecification { @Autowired InvestigationsReceiverService investigationsReceiverService; - @Autowired - InvestigationsSupport investigationsSupport; + @Autowired AssetsSupport assetsSupport; @Autowired - InvestigationNotificationsSupport investigationNotificationsSupport; + NotificationMessageSupport notificationMessageSupport; + + @Autowired + NotificationSupport notificationSupport; @Autowired AssetAsBuiltRepository assetAsBuiltRepository; @@ -89,6 +93,7 @@ void shouldReceiveNotification() { // given assetsSupport.defaultAssetsStored(); + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notificationBuild = QualityNotificationMessage.builder() .id("some-id") .notificationStatus(QualityNotificationStatus.SENT) @@ -99,7 +104,7 @@ void shouldReceiveNotification() { .sendToName("Receiver manufacturer name") .severity(QualityNotificationSeverity.MINOR) .targetDate(Instant.parse("2018-11-30T18:35:24.00Z")) - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .severity(QualityNotificationSeverity.MINOR) .messageId("messageId") .build(); @@ -107,11 +112,11 @@ void shouldReceiveNotification() { "it", notificationBuild); // when - investigationsReceiverService.handleReceive(notification); + investigationsReceiverService.handleReceive(notification, notificationType); // then - investigationsSupport.assertInvestigationsSize(1); - investigationNotificationsSupport.assertNotificationsSize(1); + notificationSupport.assertInvestigationsSize(1); + notificationMessageSupport.assertNotificationsSize(1); } @Test @@ -129,6 +134,7 @@ void shouldStartInvestigation() throws JsonProcessingException, JoseException { val request = StartQualityNotificationRequest.builder() .partIds(partIds) .description(description) + .type(QualityNotificationTypeRequest.INVESTIGATION) .severity(QualityNotificationSeverityRequest.MINOR) .isAsBuilt(true) .build(); @@ -150,7 +156,7 @@ void shouldStartInvestigation() throws JsonProcessingException, JoseException { assertThat(asset).isNotNull(); }); - investigationNotificationsSupport.assertNotificationsSize(2); + notificationMessageSupport.assertNotificationsSize(2); given() .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) @@ -336,6 +342,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .partIds(partIds) .description(description) .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.INVESTIGATION) .isAsBuilt(true) .build(); @@ -350,7 +357,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .statusCode(201) .extract().path("id"); - investigationsSupport.assertInvestigationsSize(1); + notificationSupport.assertInvestigationsSize(1); given() .contentType(ContentType.JSON) @@ -375,7 +382,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .body("content", Matchers.hasSize(1)) .body("content[0].sendTo", Matchers.is(Matchers.not(Matchers.blankOrNullString()))); - investigationNotificationsSupport.assertNotificationsSize(4); + notificationMessageSupport.assertNotificationsSize(4); } @Test @@ -391,6 +398,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept val startInvestigationRequest = StartQualityNotificationRequest.builder() .partIds(partIds) .description(description) + .type(QualityNotificationTypeRequest.INVESTIGATION) .severity(QualityNotificationSeverityRequest.MINOR) .isAsBuilt(true) .build(); @@ -408,7 +416,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .extract().path("id"); // then - investigationsSupport.assertInvestigationsSize(1); + notificationSupport.assertInvestigationsSize(1); // when given() @@ -460,9 +468,9 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body("pageSize", Matchers.is(10)) .body("content", Matchers.hasSize(1)); - investigationNotificationsSupport.assertNotificationsSize(3); - investigationsSupport.assertInvestigationsSize(1); - investigationsSupport.assertInvestigationStatus(QualityNotificationStatus.CLOSED); + notificationMessageSupport.assertNotificationsSize(3); + notificationSupport.assertInvestigationsSize(1); + notificationSupport.assertInvestigationStatus(QualityNotificationStatus.CLOSED); } @Test @@ -474,7 +482,7 @@ void givenNonExistingInvestigation_whenCancel_thenReturnNotFound() throws JoseEx .post("/api/investigations/1/cancel") .then() .statusCode(404) - .body("message", Matchers.is("Investigation not found for 1 notification id")); + .body("message", Matchers.is("Notification with id: 1 not found")); } @Test @@ -503,6 +511,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .partIds(partIds) .description(description) .severity(QualityNotificationSeverityRequest.MINOR) + .type(QualityNotificationTypeRequest.INVESTIGATION) .isAsBuilt(true) .build(); @@ -523,7 +532,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { assertThat(asset).isNotNull(); }); - investigationNotificationsSupport.assertNotificationsSize(2); + notificationMessageSupport.assertNotificationsSize(2); given() .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java index 49a2cbac3a..0fc9afb06d 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java @@ -31,6 +31,9 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; @@ -215,9 +218,10 @@ void shouldReturnPagedInvestigations() throws JoseException { .forEach( number -> { investigationsSupport.storedInvestigation( - InvestigationEntity.builder() + NotificationEntity.builder() .assets(Collections.emptyList()) .bpn(testBpn) + .type(NotificationTypeEntity.INVESTIGATION) .status(NotificationStatusBaseEntity.CREATED) .side(NotificationSideBaseEntity.SENDER) .createdDate(now) @@ -250,14 +254,14 @@ void givenNonExistingInvestigation_whenGetInvestigationById_thenReturnNotFound() .get("/api/investigations/1234") .then() .statusCode(404) - .body("message", Matchers.is("Investigation not found for 1234 notification id")); + .body("message", Matchers.is("Notification with id: 1234 not found")); } @Test void shouldReturnInvestigationById() throws JoseException { // given - InvestigationNotificationEntity storedInvestigationNotification = investigationNotificationsSupport.storeInvestigationNotification(); - InvestigationEntity storedInvestigation = storedInvestigationNotification.getInvestigation(); + NotificationMessageEntity storedInvestigationNotification = investigationNotificationsSupport.storeInvestigationNotification(); + NotificationEntity storedInvestigation = storedInvestigationNotification.getNotification(); // when/then given() diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java index a9e51a7291..393c17fefd 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java @@ -34,6 +34,7 @@ import qualitynotification.alert.response.AlertResponse; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationSeverityRequest; +import qualitynotification.base.request.QualityNotificationTypeRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; @@ -72,6 +73,7 @@ void givenRequestBody_whenAlertAssets_thenResponse() { .partIds(partIds) .description("description") .targetDate(targetDate) + .type(QualityNotificationTypeRequest.ALERT) .severity(QualityNotificationSeverityRequest.MINOR) .receiverBpn("BPN00001") .build(); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java index 8d90ce270c..e41a923649 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java @@ -18,11 +18,13 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.service.NotificationServiceImpl; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -41,28 +43,28 @@ class InvestigationServiceImplTest { @Mock - private InvestigationRepository investigationsRepositoryMock; + private NotificationRepository notificationRepository; @InjectMocks - private InvestigationServiceImpl investigationService; + private NotificationServiceImpl notificationService; @Test void testFindNotPresentInvestigationThrowsException() { // given - when(investigationsRepositoryMock.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.empty()); + when(notificationRepository.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.empty()); // expect - assertThrows(InvestigationNotFoundException.class, () -> investigationService.find(0L)); + assertThrows(NotificationNotFoundException.class, () -> notificationService.find(0L)); } @Test void testFindExistingInvestigation() { // given - when(investigationsRepositoryMock.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.of( + when(notificationRepository.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.of( InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationStatus.ACKNOWLEDGED, QualityNotificationStatus.ACKNOWLEDGED) )); // expect - QualityNotification investigation = investigationService.find(0L); + QualityNotification investigation = notificationService.find(0L); // then assertThat(investigation).isNotNull(); @@ -71,22 +73,22 @@ void testFindExistingInvestigation() { @Test void testLoadNotPresentInvestigationThrowsException() { // given - when(investigationsRepositoryMock.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.empty()); + when(notificationRepository.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.empty()); // expect QualityNotificationId investigationId = new QualityNotificationId(0L); - assertThrows(InvestigationNotFoundException.class, () -> investigationService.loadOrNotFoundException(investigationId)); + assertThrows(NotificationNotFoundException.class, () -> notificationService.loadOrNotFoundException(investigationId)); } @Test void testLoadExistingInvestigation() { // given - when(investigationsRepositoryMock.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.of( + when(notificationRepository.findOptionalQualityNotificationById(any(QualityNotificationId.class))).thenReturn(Optional.of( InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationStatus.ACKNOWLEDGED, QualityNotificationStatus.ACKNOWLEDGED) )); // expect - QualityNotification investigation = investigationService.loadOrNotFoundException(new QualityNotificationId(0L)); + QualityNotification investigation = notificationService.loadOrNotFoundException(new QualityNotificationId(0L)); // then assertThat(investigation).isNotNull(); @@ -95,22 +97,22 @@ void testLoadExistingInvestigation() { @Test void testLoadNotPresentInvestigationByEdcNotificationIdThrowsException() { // given - when(investigationsRepositoryMock.findByEdcNotificationId(any())).thenReturn(Optional.empty()); + when(notificationRepository.findByEdcNotificationId(any())).thenReturn(Optional.empty()); // expect - assertThrows(InvestigationNotFoundException.class, () -> investigationService.loadByEdcNotificationIdOrNotFoundException("0")); + assertThrows(NotificationNotFoundException.class, () -> notificationService.loadByEdcNotificationIdOrNotFoundException("0")); } @Test void testLoadPresentInvestigationByEdcNotificationId() { // given - when(investigationsRepositoryMock.findByEdcNotificationId(any())).thenReturn(Optional.of( + when(notificationRepository.findByEdcNotificationId(any())).thenReturn(Optional.of( InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationStatus.ACKNOWLEDGED, QualityNotificationStatus.ACKNOWLEDGED) ) ); // when - QualityNotification investigation = investigationService.loadByEdcNotificationIdOrNotFoundException("0"); + QualityNotification investigation = notificationService.loadByEdcNotificationIdOrNotFoundException("0"); // then assertThat(investigation).isNotNull(); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java index 9616776851..def1339aa8 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java @@ -77,6 +77,7 @@ void testhandleReceiveValidSentNotification() { // Given List affectedParts = List.of(new QualityNotificationAffectedPart("partId")); + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notification = QualityNotificationMessage.builder() .id("123") .notificationReferenceId("id123") @@ -90,7 +91,7 @@ void testhandleReceiveValidSentNotification() { .affectedParts(affectedParts) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .targetDate(Instant.now()) .messageId("messageId") .build(); @@ -101,11 +102,11 @@ void testhandleReceiveValidSentNotification() { EDCNotification edcNotification = EDCNotificationFactory.createEdcNotification( "it", notification); - when(mockNotificationMapper.toNotification(edcNotification)).thenReturn(notificationTestData); - when(mockQualityNotificationMapper.toQualityNotification(any(BPN.class), anyString(), any(QualityNotificationMessage.class))).thenReturn(investigationTestData); + when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); + when(mockQualityNotificationMapper.toQualityNotification(any(BPN.class), anyString(), any(QualityNotificationMessage.class), any(QualityNotificationType.class))).thenReturn(investigationTestData); // When - service.handleReceive(edcNotification); + service.handleReceive(edcNotification, notificationType); // Then Mockito.verify(mockRepository).saveQualityNotificationEntity(investigationTestData); } @@ -117,7 +118,7 @@ void testHandleNotificationUpdateValidAcknowledgeNotificationTransition() { // Given List affectedParts = List.of(new QualityNotificationAffectedPart("partId")); - + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notification = QualityNotificationMessage.builder() .id("123") .notificationReferenceId("id123") @@ -129,7 +130,7 @@ void testHandleNotificationUpdateValidAcknowledgeNotificationTransition() { .description("123") .notificationStatus(QualityNotificationStatus.ACKNOWLEDGED) .affectedParts(affectedParts) - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") .targetDate(Instant.now()) @@ -142,11 +143,11 @@ void testHandleNotificationUpdateValidAcknowledgeNotificationTransition() { EDCNotification edcNotification = EDCNotificationFactory.createEdcNotification( "it", notification); - when(mockNotificationMapper.toNotification(edcNotification)).thenReturn(notificationTestData); + when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When - service.handleUpdate(edcNotification); + service.handleUpdate(edcNotification, notificationType); // Then Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); } @@ -157,7 +158,7 @@ void testhandleUpdateValidDeclineNotificationTransition() { // Given List affectedParts = List.of(new QualityNotificationAffectedPart("partId")); - + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notification = QualityNotificationMessage.builder() .id("123") .notificationReferenceId("id123") @@ -171,7 +172,7 @@ void testhandleUpdateValidDeclineNotificationTransition() { .affectedParts(affectedParts) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .targetDate(Instant.now()) .messageId("messageId") .build(); @@ -181,11 +182,11 @@ void testhandleUpdateValidDeclineNotificationTransition() { EDCNotification edcNotification = EDCNotificationFactory.createEdcNotification( "it", notification); - when(mockNotificationMapper.toNotification(edcNotification)).thenReturn(notificationTestData); + when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When - service.handleUpdate(edcNotification); + service.handleUpdate(edcNotification, notificationType); // Then Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); } @@ -196,7 +197,7 @@ void testhandleUpdateValidAcceptedNotificationTransition() { // Given List affectedParts = List.of(new QualityNotificationAffectedPart("partId")); - + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notification = QualityNotificationMessage.builder() .id("123") .notificationReferenceId("id123") @@ -210,7 +211,7 @@ void testhandleUpdateValidAcceptedNotificationTransition() { .affectedParts(affectedParts) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .targetDate(Instant.now()) .messageId("messageId") .build(); @@ -220,11 +221,11 @@ void testhandleUpdateValidAcceptedNotificationTransition() { EDCNotification edcNotification = EDCNotificationFactory.createEdcNotification( "it", notification); - when(mockNotificationMapper.toNotification(edcNotification)).thenReturn(notificationTestData); + when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When - service.handleUpdate(edcNotification); + service.handleUpdate(edcNotification, notificationType); // Then Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); } @@ -235,7 +236,7 @@ void testhandleUpdateValidCloseNotificationTransition() { // Given List affectedParts = List.of(new QualityNotificationAffectedPart("partId")); - + QualityNotificationType notificationType = QualityNotificationType.INVESTIGATION; QualityNotificationMessage notification = QualityNotificationMessage.builder() .id("123") .notificationReferenceId("id123") @@ -249,7 +250,7 @@ void testhandleUpdateValidCloseNotificationTransition() { .affectedParts(affectedParts) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") - .type(QualityNotificationType.INVESTIGATION) + .type(notificationType) .targetDate(Instant.now()) .messageId("messageId") .build(); @@ -259,11 +260,11 @@ void testhandleUpdateValidCloseNotificationTransition() { EDCNotification edcNotification = EDCNotificationFactory.createEdcNotification( "it", notification); - when(mockNotificationMapper.toNotification(edcNotification)).thenReturn(notificationTestData); + when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When - service.handleUpdate(edcNotification); + service.handleUpdate(edcNotification, notificationType); // Then Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/NotificationTestDataFactory.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/NotificationTestDataFactory.java index 921eac19ea..f654c00c71 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/NotificationTestDataFactory.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/NotificationTestDataFactory.java @@ -44,6 +44,7 @@ public static QualityNotificationMessage createNotificationTestData() { .description("123") .notificationStatus(QualityNotificationStatus.ACKNOWLEDGED) .affectedParts(affectedParts) + .type(QualityNotificationType.INVESTIGATION) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") .targetDate(Instant.parse("2022-03-01T12:00:00Z")) From f22cf94295f0f05b88b3a4d0625413f30492c2ab Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 01:43:18 +0100 Subject: [PATCH 03/13] chore(tx-backend) 706 temp save work --- .../domain/base/AlertRepository.java | 6 - .../repository/AlertsRepositoryImpl.java | 12 -- .../alert/AlertsRepositoryIT.java | 103 ------------------ .../InvestigationsReceiverServiceTest.java | 25 ++--- 4 files changed, 11 insertions(+), 135 deletions(-) delete mode 100644 tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java index 9ef29a3636..980155d608 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java @@ -19,13 +19,7 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.base; -import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; -import java.util.List; - public interface AlertRepository extends QualityNotificationRepository { - - long countPartsByStatusAndOwnership(List statuses, Owner owner); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java index 5d63394cb3..5c4d510c57 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java @@ -146,18 +146,6 @@ public Optional findByNotificationMessageId(String id) { return jpaAlertRepository.findByNotificationMessageId(id).map(AlertEntity::toDomain); } - @Transactional - @Override - public long countPartsByStatusAndOwnership(List statuses, Owner owner) { - return jpaAlertRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(statuses)) - .stream() - .map(AlertEntity::getAssets) - .flatMap(Collection::stream) - .filter(assetAsBuiltEntity -> assetAsBuiltEntity.getOwner().equals(owner)) - .distinct() - .toList().size(); - } - @Override public long countOpenNotificationsByOwnership(List owners) { return jpaAlertRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java deleted file mode 100644 index 5b5e9d5df4..0000000000 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertsRepositoryIT.java +++ /dev/null @@ -1,103 +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.integration.qualitynotification.alert; - -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.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; -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.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; - -class AlertsRepositoryIT extends IntegrationTestSpecification { - - @Autowired - JpaNotificationRepository jpaNotificationRepository; - - @Autowired - AlertsSupport alertsSupport; - - @Autowired - AssetsSupport assetsSupport; - - @Autowired - JpaAssetAsBuiltRepository assetAsBuiltRepository; - - @Autowired - AlertRepository repository; - - @Test - void givenAlertsWithAssets_whenCountDistinctAffectedSupplierPartsWithAlertReceivedStatus_thenReturnProperCount() { - // given - assetsSupport.defaultAssetsStored(); - List assets = assetAsBuiltRepository.findAll(); - List ownAssets = assets.stream() - .filter(asset -> asset.getOwner().equals(Owner.OWN)) - .toList(); - List supplierAssets = assets.stream() - .filter(asset -> asset.getOwner().equals(Owner.SUPPLIER)) - .toList(); - alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); - alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); - alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); - assertThat(jpaNotificationRepository.findAll()).hasSize(3); - - // when - Long result = repository.countPartsByStatusAndOwnership(List.of(QualityNotificationStatus.RECEIVED), Owner.SUPPLIER); - - // then - assertThat(result).isEqualTo(12); - } - - @Test - void givenAlertsWithAssets_whenCountDistinctAffectedOwnPartsWithAlertSentStatus_thenReturnProperCount() { - // given - assetsSupport.defaultAssetsStored(); - List assets = assetAsBuiltRepository.findAll(); - List ownAssets = assets.stream() - .filter(asset -> asset.getOwner().equals(Owner.OWN)) - .toList(); - List supplierAssets = assets.stream() - .filter(asset -> asset.getOwner().equals(Owner.SUPPLIER)) - .toList(); - alertsSupport.storeAlertWithStatusAndAssets(RECEIVED, supplierAssets, null); - alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); - alertsSupport.storeAlertWithStatusAndAssets(SENT, ownAssets, null); - assertThat(jpaNotificationRepository.findAll()).hasSize(3); - - // when - Long result = repository.countPartsByStatusAndOwnership(List.of(QualityNotificationStatus.SENT), Owner.OWN); - - // then - assertThat(result).isEqualTo(1); - } -} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java index def1339aa8..ee131c0350 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java @@ -19,11 +19,10 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.service; -import org.eclipse.tractusx.traceability.assets.domain.asbuilt.service.AssetAsBuiltServiceImpl; import org.eclipse.tractusx.traceability.common.mapper.NotificationMessageMapper; import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; @@ -56,7 +55,7 @@ class InvestigationsReceiverServiceTest { @Mock - private InvestigationRepository mockRepository; + private NotificationRepository notificationRepository; @Mock private NotificationMessageMapper mockNotificationMapper; @@ -64,8 +63,6 @@ class InvestigationsReceiverServiceTest { @Mock private QualityNotificationMapper mockQualityNotificationMapper; - @Mock - private AssetAsBuiltServiceImpl assetService; @InjectMocks private InvestigationsReceiverService service; @@ -108,7 +105,7 @@ void testhandleReceiveValidSentNotification() { // When service.handleReceive(edcNotification, notificationType); // Then - Mockito.verify(mockRepository).saveQualityNotificationEntity(investigationTestData); + Mockito.verify(notificationRepository).saveQualityNotificationEntity(investigationTestData); } @Test @@ -144,12 +141,12 @@ void testHandleNotificationUpdateValidAcknowledgeNotificationTransition() { "it", notification); when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); - when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); + when(notificationRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When service.handleUpdate(edcNotification, notificationType); // Then - Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); + Mockito.verify(notificationRepository).updateQualityNotificationEntity(investigationTestData); } @Test @@ -183,12 +180,12 @@ void testhandleUpdateValidDeclineNotificationTransition() { "it", notification); when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); - when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); + when(notificationRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When service.handleUpdate(edcNotification, notificationType); // Then - Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); + Mockito.verify(notificationRepository).updateQualityNotificationEntity(investigationTestData); } @Test @@ -222,12 +219,12 @@ void testhandleUpdateValidAcceptedNotificationTransition() { "it", notification); when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); - when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); + when(notificationRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When service.handleUpdate(edcNotification, notificationType); // Then - Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); + Mockito.verify(notificationRepository).updateQualityNotificationEntity(investigationTestData); } @Test @@ -261,12 +258,12 @@ void testhandleUpdateValidCloseNotificationTransition() { "it", notification); when(mockNotificationMapper.toNotification(edcNotification, notificationType)).thenReturn(notificationTestData); - when(mockRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); + when(notificationRepository.findByEdcNotificationId(edcNotification.getNotificationId())).thenReturn(Optional.of(investigationTestData)); // When service.handleUpdate(edcNotification, notificationType); // Then - Mockito.verify(mockRepository).updateQualityNotificationEntity(investigationTestData); + Mockito.verify(notificationRepository).updateQualityNotificationEntity(investigationTestData); } } From cbc20a89555238937d726fcade0b2bf293bc1826 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 02:10:47 +0100 Subject: [PATCH 04/13] chore(tx-backend) 706 temp save work --- .../openapi/traceability-foss-backend.json | 6575 ++++++++++++++++- .../alert/rest/AlertController.java | 591 -- .../mapper/InvestigationResponseMapper.java | 106 - .../rest/InvestigationsController.java | 584 -- .../mapper/NotificationResponseMapper.java} | 21 +- .../QualityNotificationFieldMapper.java | 2 +- .../mapper/QualityNotificationMapper.java | 2 +- .../rest/NotificationController.java | 16 +- .../service/QualityNotificationService.java | 2 +- .../AbstractQualityNotificationService.java | 2 +- .../assets/DashboardControllerIT.java | 2 +- .../alert/AlertControllerFilterIT.java | 32 +- .../alert/AlertControllerFilterValuesIT.java | 26 +- .../alert/PublisherAlertsControllerIT.java | 44 +- .../alert/ReadAlertsControllerIT.java | 24 +- .../alert/ReceiverAlertsControllerIT.java | 16 +- .../InvestigationControllerFilterIT.java | 30 +- ...InvestigationControllerFilterValuesIT.java | 26 +- .../PublisherInvestigationsControllerIT.java | 44 +- .../ReadInvestigationsControllerIT.java | 24 +- .../ReceiverInvestigationsControllerIT.java | 8 +- .../alert/response/AlertResponseTest.java | 10 +- .../alert/rest/AlertControllerTest.java | 9 +- .../alert/response/AlertResponse.java | 33 - .../response/QualityNotificationResponse.java | 2 + 25 files changed, 6746 insertions(+), 1485 deletions(-) delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{alert/mapper/AlertResponseMapper.java => notification/mapper/NotificationResponseMapper.java} (84%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{base => notification}/mapper/QualityNotificationFieldMapper.java (98%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{base => notification}/mapper/QualityNotificationMapper.java (99%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{base => }/service/QualityNotificationService.java (99%) delete mode 100644 tx-models/src/main/java/qualitynotification/alert/response/AlertResponse.java diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index a2f84765e3..f8988552fd 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1 +1,6574 @@ -{"openapi":"3.0.1","info":{"title":"Tractus-X Traceability Foss","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"},"servers":[{"url":"http://localhost:9998/api","description":"Generated server url"}],"security":[{"oAuth2":["profile email"]}],"tags":[{"name":"Investigations","description":"Operations on Investigation Notification"}],"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":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for BpnEdcMapping","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"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"}}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for BpnEdcMapping","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"$ref":"#/components/schemas/BpnEdcMappingResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"submodelId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns submodel payload","content":{"application/json":{"schema":{"type":"string"}}}}},"security":[{"oAuth2":["profile email"]}]},"post":{"tags":["Submodel"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."}},"security":[{"oAuth2":["profile email"]}]}},"/notifications":{"post":{"tags":["Notifications"],"operationId":"alertAssets","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}}}},"/notifications/{notificationId}/update":{"post":{"tags":["Notifications"],"operationId":"updateAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/close":{"post":{"tags":["Notifications"],"operationId":"closeAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/cancel":{"post":{"tags":["Notifications"],"operationId":"cancelAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/{notificationId}/approve":{"post":{"tags":["Notifications"],"operationId":"approveAlert","parameters":[{"name":"notificationId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"No Content"}}}},"/notifications/filter":{"post":{"tags":["Notifications"],"operationId":"getAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultAlertResponse"}}}}}}}},"/investigations":{"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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/update":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/close":{"post":{"tags":["Investigations"],"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"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/cancel":{"post":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/{investigationId}/approve":{"post":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/filter":{"post":{"tags":["Investigations"],"summary":"Filter investigations defined by the request body","description":"The endpoint returns investigations as paged result.","operationId":"filterInvestigations","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"maxItems":2147483647,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/edc/notification/contract":{"post":{"tags":["Notifications"],"summary":"Triggers EDC notification contract","description":"The endpoint Triggers EDC notification contract based on notification type and method","operationId":"createNotificationContract","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/contracts":{"post":{"tags":["Contracts"],"summary":"All contract agreements for all assets","description":"This endpoint returns all contract agreements for all assets in Trace-X","operationId":"contracts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Internal server error."}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Not found."}}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Forbidden."}}}}},"200":{"description":"Ok.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultContractResponse"}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Unsupported media type."}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Authorization failed."}}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Bad request."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Too many requests."}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/publish":{"post":{"tags":["AssetsImport","AssetsPublish"],"summary":"asset publish","description":"This endpoint publishes assets to the Catena-X network.","operationId":"publishAssets","parameters":[{"name":"triggerSynchronizeAssets","in":"query","required":false,"schema":{"type":"boolean","default":true}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAssetRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import":{"post":{"tags":["AssetsImport"],"summary":"asset upload","description":"This endpoint stores assets in the application. Those can be later published in the Catena-X network.","operationId":"importJson","requestBody":{"content":{"multipart/form-data":{"schema":{"required":["file"],"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."}},"security":[{"oAuth2":["profile email"]}]}},"/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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts":{"post":{"tags":["Alerts"],"summary":"Start alert by part ids","description":"The endpoint starts alert based on part ids provided.","operationId":"alertAssets_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/update":{"post":{"tags":["Alerts"],"summary":"Update alert by id","description":"The endpoint updates alert by their id.","operationId":"updateAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/close":{"post":{"tags":["Alerts"],"summary":"Close alert by id","description":"The endpoint closes alert by id.","operationId":"closeAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseQualityNotificationRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"204":{"description":"No content."},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/cancel":{"post":{"tags":["Alerts"],"summary":"Cancels alert by id","description":"The endpoint cancels alert by id.","operationId":"cancelAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}/approve":{"post":{"tags":["Alerts"],"summary":"Approves alert by id","description":"The endpoint approves alert by id.","operationId":"approveAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/filter":{"post":{"tags":["Alerts"],"summary":"Filter alerts defined by the request body","description":"The endpoint returns alerts as paged result.","operationId":"filterAlerts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageableFilterRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/{assetId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by id","description":"The endpoint returns an asset filtered by id .","operationId":"assetById","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","content":{"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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]},"patch":{"tags":["AssetsAsPlanned"],"summary":"Updates asset","description":"The endpoint updates asset by provided quality type.","operationId":"updateAsset","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetRequest"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the updated asset","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Assets","items":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}},"required":true},"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/registry/reload":{"get":{"tags":["Registry"],"summary":"Triggers reload of shell descriptors","description":"The endpoint Triggers reload of shell descriptors.","operationId":"reload","responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"202":{"description":"Created registry reload job."},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/policies":{"get":{"tags":["Policies"],"summary":"Get all policies ","description":"The endpoint returns all policies .","operationId":"policy","responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Returns the policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/notifications/{notificationId}":{"get":{"tags":["Notifications"],"operationId":"getAlert","parameters":[{"name":"notificationId","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"}}}}}}}},"/notifications/distinctFilterValues":{"get":{"tags":["Notifications"],"operationId":"distinctFilterValues","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}}}},"/investigations/{investigationId}":{"get":{"tags":["Investigations"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"$ref":"#/components/schemas/InvestigationResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/investigations/distinctFilterValues":{"get":{"tags":["Assets","Investigations"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/dashboard":{"get":{"tags":["Dashboard"],"summary":"Returns dashboard related data","description":"The endpoint can return limited data based on the user role","operationId":"dashboard","responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns dashboard data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/import/report/{importJobId}":{"get":{"tags":["ImportReport","AssetsImport"],"summary":"report of the imported assets","description":"This endpoint returns information about the imported assets to Trace-X.","operationId":"importReport","parameters":[{"name":"importJobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReportResponse"}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned":{"get":{"tags":["AssetsAsPlanned"],"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":"filter","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/distinctFilterValues":{"get":{"tags":["Assets","AssetsAsPlanned"],"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":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":false,"schema":{"type":"string"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-planned/*/children/{childId}":{"get":{"tags":["AssetsAsPlanned"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildIdAndAssetId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built":{"get":{"tags":["AssetsAsBuilt"],"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":"searchCriteriaRequestParam","in":"query","required":true,"schema":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}],"responses":{"404":{"description":"Not found.","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"}}}},"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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/distinctFilterValues":{"get":{"tags":["AssetsAsBuilt","Assets"],"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":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"owner","in":"query","required":true,"schema":{"type":"string","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/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":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the assets found","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}}},"security":[{"oAuth2":["profile email"]}]}},"/assets/as-built/*/children/{childId}":{"get":{"tags":["AssetsAsBuilt"],"summary":"Get asset by child id","description":"The endpoint returns an asset filtered by child id.","operationId":"assetByChildId","parameters":[{"name":"childId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"},"semanticModelId":{"maxLength":255,"minLength":0,"type":"string","example":"NO-246880451848384868750731"},"businessPartner":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"manufacturerName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"nameAtManufacturer":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"manufacturerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"owner":{"type":"string","example":"CUSTOMER","enum":["SUPPLIER","CUSTOMER","OWN","UNKNOWN"]},"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"}},"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]},"van":{"maxLength":255,"minLength":0,"type":"string","example":"OMAYSKEITUGNVHKKX"},"semanticDataModel":{"type":"string","example":"BATCH","enum":["BATCH","SERIALPART","UNKNOWN","PARTASPLANNED","JUSTINSEQUENCE","TOMBSTONEASBUILT","TOMBSTONEASPLANNED"]},"classification":{"maxLength":255,"minLength":0,"type":"string","example":"component"},"detailAspectModels":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectModelResponse"}},"sentQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"receivedQualityAlertIdsInStatusActive":{"type":"array","example":1,"items":{"type":"integer","format":"int64","example":1}},"sentQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"receivedQualityInvestigationIdsInStatusActive":{"type":"array","example":2,"items":{"type":"integer","format":"int64","example":2}},"importState":{"type":"string","example":"TRANSIENT","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"importNote":{"type":"string","example":"Asset created successfully in transient state"},"tombstone":{"type":"string","example":" {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n"},"contractAgreementId":{"type":"string","example":"TODO"}}}}}}},"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"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/{alertId}":{"get":{"tags":["Alerts"],"summary":"Gets Alert by id","description":"The endpoint returns alert by id.","operationId":"getAlert_1","parameters":[{"name":"alertId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/alerts/distinctFilterValues":{"get":{"tags":["Assets","Alerts"],"summary":"getDistinctFilterValues","description":"The endpoint returns a distinct filter values for given fieldName.","operationId":"distinctFilterValues_4","parameters":[{"name":"fieldName","in":"query","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"startWith","in":"query","required":true,"schema":{"type":"string"}},{"name":"channel","in":"query","required":true,"schema":{"type":"string","enum":["SENDER","RECEIVER"]}}],"responses":{"404":{"description":"Not found.","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","items":{"type":"string"}}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"oAuth2":["profile email"]}]}},"/submodel/data":{"delete":{"tags":["Submodel"],"summary":"Delete All Submodels","description":"Deletes all submodels from the system.","operationId":"deleteSubmodels","responses":{"404":{"description":"Not found.","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"}}}},"200":{"description":"Ok."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."}},"security":[{"oAuth2":["profile email"]}]}},"/bpn-config/{bpn}":{"delete":{"tags":["BpnEdcMapping"],"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"}}],"responses":{"404":{"description":"Not found.","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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"Deleted."},"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"}}}},"200":{"description":"Okay"}},"security":[{"oAuth2":["profile email"]}]}}},"components":{"schemas":{"BpnMappingRequest":{"required":["bpn","url"],"type":"object","properties":{"bpn":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003CSGV"},"url":{"maxLength":255,"minLength":0,"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"maxLength":1000,"minLength":0,"pattern":"^.*$","type":"string","example":"Access Denied"}}},"BpnEdcMappingResponse":{"type":"object","properties":{"bpn":{"type":"string","example":"BPNL00000003CSGV"},"url":{"type":"string","example":"https://trace-x-test-edc.dev.demo.catena-x.net/a1"}}},"StartQualityNotificationRequest":{"required":["severity"],"type":"object","properties":{"partIds":{"maxLength":100,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"],"items":{"maxLength":100,"minLength":1,"type":"string","example":"[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]"}},"description":{"maxLength":1000,"minLength":15,"type":"string","example":"The description"},"targetDate":{"type":"string","format":"date-time","example":"2099-03-11T22:44:06.333826952Z"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"receiverBpn":{"type":"string","example":"BPN00001123123AS"},"type":{"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"asBuilt":{"type":"boolean"}}},"QualityNotificationIdResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64","example":1}}},"UpdateQualityNotificationRequest":{"required":["status"],"type":"object","properties":{"status":{"type":"string","description":"The UpdateInvestigationStatus","enum":["ACKNOWLEDGED","ACCEPTED","DECLINED"]},"reason":{"type":"string","example":"The reason."}}},"CloseQualityNotificationRequest":{"type":"object","properties":{"reason":{"maxLength":1000,"minLength":15,"type":"string","example":"The reason."}}},"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"}}}},"PageableFilterRequest":{"type":"object","properties":{"pageAble":{"$ref":"#/components/schemas/OwnPageable"},"searchCriteria":{"$ref":"#/components/schemas/SearchCriteriaRequestParam"}}},"SearchCriteriaRequestParam":{"type":"object","properties":{"filter":{"maxItems":2147483647,"type":"array","description":"Filter Criteria","example":"owner,EQUAL,OWN","items":{"type":"string"}}}},"AlertResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"PageResultAlertResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"QualityNotificationMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string"},"sendTo":{"type":"string"},"sendToName":{"type":"string"},"contractAgreementId":{"type":"string"},"notificationReferenceId":{"type":"string"},"targetDate":{"type":"string","format":"date-time"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"edcNotificationId":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"messageId":{"type":"string"},"status":{"type":"string","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"}}},"QualityNotificationReasonResponse":{"type":"object","properties":{"close":{"maxLength":1000,"minLength":0,"type":"string","example":"description of closing reason"},"accept":{"maxLength":1000,"minLength":0,"type":"string","example":"description of accepting reason"},"decline":{"maxLength":1000,"minLength":0,"type":"string","example":"description of declining reason"}}},"InvestigationResponse":{"type":"object","properties":{"id":{"maximum":255,"minimum":0,"maxLength":255,"type":"integer","format":"int64","example":66},"status":{"maxLength":255,"minLength":0,"type":"string","example":"CREATED","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"description":{"maxLength":1000,"minLength":0,"type":"string","example":"DescriptionText"},"createdBy":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"createdByName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"createdDate":{"maxLength":50,"minLength":0,"type":"string","example":"2023-02-21T21:27:10.734950Z"},"assetIds":{"maxItems":1000,"minItems":0,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd","urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]"}},"channel":{"maxLength":255,"minLength":0,"type":"string","example":"SENDER","enum":["SENDER","RECEIVER"]},"reason":{"$ref":"#/components/schemas/QualityNotificationReasonResponse"},"sendTo":{"maxLength":255,"minLength":0,"type":"string","example":"BPNL00000003AYRE"},"sendToName":{"maxLength":255,"minLength":0,"type":"string","example":"Tier C"},"severity":{"maxLength":255,"minLength":0,"type":"string","example":"MINOR","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"type":{"maxLength":50,"minLength":0,"type":"string","example":"ALERT","enum":["ALERT","INVESTIGATION"]},"targetDate":{"maxLength":50,"minLength":0,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"CreateNotificationContractRequest":{"required":["notificationMethod","notificationType"],"type":"object","properties":{"notificationType":{"type":"string","enum":["QUALITY_INVESTIGATION","QUALITY_ALERT"]},"notificationMethod":{"type":"string","enum":["RECEIVE","UPDATE","RESOLVE"]}}},"CreateNotificationContractResponse":{"type":"object","properties":{"notificationAssetId":{"type":"string","example":"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"},"accessPolicyId":{"type":"string","example":"123"},"contractDefinitionId":{"type":"string","example":"456"}}},"ContractResponse":{"type":"object","properties":{"contractId":{"maxLength":255,"type":"string","example":"66"},"counterpartyAddress":{"maxLength":255,"type":"string","example":"https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp"},"creationDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"endDate":{"maxLength":255,"type":"string","format":"date-time","example":"2023-02-21T21:27:10.73495Z"},"state":{"maxLength":255,"type":"string","example":"FINALIZED"},"policy":{"maxLength":255,"type":"string","example":"{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}"}}},"PageResultContractResponse":{"type":"object","properties":{"content":{"maxItems":2147483647,"minItems":0,"type":"array","description":"Content of PageResults","items":{"$ref":"#/components/schemas/ContractResponse"}},"page":{"type":"integer","format":"int32","example":1},"pageCount":{"type":"integer","format":"int32","example":15},"pageSize":{"type":"integer","format":"int32","example":10},"totalItems":{"type":"integer","format":"int64","example":2}}},"RegisterAssetRequest":{"required":["assetIds","policyId"],"type":"object","properties":{"policyId":{"type":"string","example":"a644a7cb-3de5-493b-9259-f01db315a46e"},"assetIds":{"type":"array","items":{"type":"string"}}}},"ImportResponse":{"type":"object","properties":{"jobId":{"type":"string"},"importStateMessage":{"type":"array","items":{"$ref":"#/components/schemas/ImportStateMessage"}},"validationResult":{"$ref":"#/components/schemas/ValidationResponse"}}},"ImportStateMessage":{"type":"object","properties":{"catenaXId":{"type":"string"},"persistedOrUpdated":{"type":"boolean"}}},"ValidationResponse":{"type":"object","properties":{"validationErrors":{"type":"array","items":{"type":"string"}}}},"SyncAssetsRequest":{"type":"object","properties":{"globalAssetIds":{"maxItems":100,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"GetDetailInformationRequest":{"type":"object","properties":{"assetIds":{"maxLength":50,"minLength":1,"maxItems":50,"minItems":1,"type":"array","example":["urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd"],"items":{"maxLength":50,"minLength":1,"type":"string","example":"[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]"}}}},"DescriptionsResponse":{"type":"object","properties":{"id":{"maxLength":255,"minLength":0,"type":"string","example":"urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0"},"idShort":{"maxLength":255,"minLength":0,"type":"string","example":"assembly-part-relationship"}}},"DetailAspectDataAsBuiltResponse":{"type":"object","properties":{"partId":{"maxLength":255,"minLength":0,"type":"string","example":"95657762-59"},"customerPartId":{"maxLength":255,"minLength":0,"type":"string","example":"01697F7-65"},"nameAtCustomer":{"maxLength":255,"minLength":0,"type":"string","example":"Door front-left"},"manufacturingCountry":{"maxLength":255,"minLength":0,"type":"string","example":"DEU"},"manufacturingDate":{"maxLength":255,"minLength":0,"type":"string","example":"2022-02-04T13:48:54Z"}}},"DetailAspectDataAsPlannedResponse":{"type":"object","properties":{"validityPeriodFrom":{"maxLength":255,"minLength":0,"type":"string","example":"2022-09-26T12:43:51.079Z"},"validityPeriodTo":{"maxLength":255,"minLength":0,"type":"string","example":"20232-07-13T12:00:00.000Z"}}},"DetailAspectDataResponse":{"type":"object","oneOf":[{"$ref":"#/components/schemas/DetailAspectDataAsBuiltResponse"},{"$ref":"#/components/schemas/DetailAspectDataAsPlannedResponse"},{"$ref":"#/components/schemas/PartSiteInformationAsPlannedResponse"},{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeResponse"}]},"DetailAspectDataTractionBatteryCodeResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"},"subcomponents":{"type":"array","items":{"$ref":"#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse"}}}},"DetailAspectDataTractionBatteryCodeSubcomponentResponse":{"type":"object","properties":{"productType":{"maxLength":255,"minLength":0,"type":"string","example":"pack"},"tractionBatteryCode":{"maxLength":255,"minLength":0,"type":"string","example":"X12MCPM27KLPCLX2M2382320"}}},"DetailAspectModelResponse":{"type":"object","properties":{"type":{"type":"string","example":"PART_SITE_INFORMATION_AS_PLANNED","enum":["AS_BUILT","AS_PLANNED","TRACTION_BATTERY_CODE","SINGLE_LEVEL_BOM_AS_BUILT","SINGLE_LEVEL_USAGE_AS_BUILT","SINGLE_LEVEL_BOM_AS_PLANNED","PART_SITE_INFORMATION_AS_PLANNED"]},"data":{"$ref":"#/components/schemas/DetailAspectDataResponse"}}},"PartSiteInformationAsPlannedResponse":{"type":"object","properties":{"functionValidUntil":{"type":"string","example":"2025-02-08T04:30:48.000Z"},"function":{"type":"string","example":"production"},"functionValidFrom":{"type":"string","example":"2023-10-13T14:30:45+01:00"},"catenaXSiteId":{"type":"string","example":"urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003"}}},"UpdateAssetRequest":{"required":["qualityType"],"type":"object","properties":{"qualityType":{"type":"string","example":"Ok","enum":["Ok","Minor","Major","Critical","LifeThreatening"]}}},"ConstraintResponse":{"type":"object","properties":{"leftOperand":{"type":"string","example":"PURPOSE"},"operatorTypeResponse":{"type":"string","enum":["EQ","NEQ","LT","GT","IN","LTEQ","GTEQ","ISA","HASPART","ISPARTOF","ISONEOF","ISALLOF","ISNONEOF"]},"rightOperand":{"type":"string","example":"ID Trace 3.1"}}},"ConstraintsResponse":{"type":"object","properties":{"and":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}},"or":{"type":"array","items":{"$ref":"#/components/schemas/ConstraintResponse"}}}},"PermissionResponse":{"type":"object","properties":{"action":{"type":"string","example":"USE","enum":["ACCESS","USE"]},"constraints":{"$ref":"#/components/schemas/ConstraintsResponse"}}},"PolicyResponse":{"type":"object","properties":{"policyId":{"type":"string","example":"5a00bb50-0253-405f-b9f1-1a3150b9d51d"},"createdOn":{"type":"string","format":"date-time"},"validUntil":{"type":"string","format":"date-time"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionResponse"}}}},"DashboardResponse":{"type":"object","properties":{"asBuiltCustomerParts":{"type":"integer","format":"int64","example":5},"asPlannedCustomerParts":{"type":"integer","format":"int64","example":10},"asBuiltSupplierParts":{"type":"integer","format":"int64","example":2},"asPlannedSupplierParts":{"type":"integer","format":"int64","example":3},"asBuiltOwnParts":{"type":"integer","format":"int64","example":1},"asPlannedOwnParts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"myPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"customerPartsWithOpenAlerts":{"type":"integer","format":"int64","example":1},"supplierPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"customerPartsWithOpenInvestigations":{"type":"integer","format":"int64","example":2},"receivedActiveAlerts":{"type":"integer","format":"int64","example":2},"receivedActiveInvestigations":{"type":"integer","format":"int64","example":2},"sentActiveAlerts":{"type":"integer","format":"int64","example":2},"sentActiveInvestigations":{"type":"integer","format":"int64","example":2}}},"ImportJobResponse":{"type":"object","properties":{"importJobStatus":{"type":"string","enum":["INITIALIZING","RUNNING","ERROR","COMPLETED"]},"importId":{"type":"string","example":"456a952e-05eb-40dc-a6f2-9c2cb9c1387f"},"startedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"completedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"}}},"ImportReportResponse":{"type":"object","properties":{"importJob":{"$ref":"#/components/schemas/ImportJobResponse"},"importedAsset":{"type":"array","items":{"$ref":"#/components/schemas/ImportedAssetResponse"}}}},"ImportedAssetResponse":{"type":"object","properties":{"importState":{"type":"string","enum":["TRANSIENT","PERSISTENT","ERROR","IN_SYNCHRONIZATION","PUBLISHED_TO_CORE_SERVICES","UNSET"]},"catenaxId":{"type":"string","example":"urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}"},"importedOn":{"maxLength":50,"type":"string","example":"2099-02-21T21:27:10.734950Z"},"importMessage":{"type":"string","example":"Asset created successfully in transient state."}}}},"securitySchemes":{"oAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://example.com/api/oauth/token","scopes":{"profile email":""}}}}}}} \ No newline at end of file +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Tractus-X Traceability Foss", + "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" + }, + "servers" : [ + { + "url" : "http://localhost:9998/api", + "description" : "Generated server url" + } + ], + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ], + "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" : { + "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" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + }, + "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" + } + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + }, + "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" + } + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" : [ + { + "name" : "submodelId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "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" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns submodel payload", + "content" : { + "application/json" : { + "schema" : { + "type" : "string" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + }, + "post" : { + "tags" : [ + "Submodel" + ], + "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" + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, + "required" : true + }, + "responses" : { + "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" : "Ok." + }, + "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" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/notifications" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "alertAssets", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StartQualityNotificationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "Created", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/QualityNotificationIdResponse" + } + } + } + } + } + } + }, + "/notifications/{notificationId}/update" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "updateAlert", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No Content" + } + } + } + }, + "/notifications/{notificationId}/close" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "closeAlert", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CloseQualityNotificationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No Content" + } + } + } + }, + "/notifications/{notificationId}/cancel" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "cancelAlert", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "responses" : { + "204" : { + "description" : "No Content" + } + } + } + }, + "/notifications/{notificationId}/approve" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "approveAlert", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "responses" : { + "204" : { + "description" : "No Content" + } + } + } + }, + "/notifications/filter" : { + "post" : { + "tags" : [ + "Notifications" + ], + "operationId" : "getAlerts", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PageableFilterRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultQualityNotificationResponse" + } + } + } + } + } + } + } + }, + "/edc/notification/contract" : { + "post" : { + "tags" : [ + "Notifications" + ], + "summary" : "Triggers EDC notification contract", + "description" : "The endpoint Triggers EDC notification contract based on notification type and method", + "operationId" : "createNotificationContract", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateNotificationContractRequest" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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" + } + } + } + }, + "201" : { + "description" : "Created.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateNotificationContractResponse" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/contracts" : { + "post" : { + "tags" : [ + "Contracts" + ], + "summary" : "All contract agreements for all assets", + "description" : "This endpoint returns all contract agreements for all assets in Trace-X", + "operationId" : "contracts", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PageableFilterRequest" + } + } + }, + "required" : true + }, + "responses" : { + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Forbidden." + } + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Too many requests." + } + } + } + } + }, + "200" : { + "description" : "Ok.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" + } + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Authorization failed." + } + } + } + } + }, + "415" : { + "description" : "Unsupported media type.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Unsupported media type." + } + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Internal server error." + } + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Bad request." + } + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Not found." + } + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/publish" : { + "post" : { + "tags" : [ + "AssetsImport", + "AssetsPublish" + ], + "summary" : "asset publish", + "description" : "This endpoint publishes assets to the Catena-X network.", + "operationId" : "publishAssets", + "parameters" : [ + { + "name" : "triggerSynchronizeAssets", + "in" : "query", + "required" : false, + "schema" : { + "type" : "boolean", + "default" : true + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/RegisterAssetRequest" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/import" : { + "post" : { + "tags" : [ + "AssetsImport" + ], + "summary" : "asset upload", + "description" : "This endpoint stores assets in the application. Those can be later published in the Catena-X network.", + "operationId" : "importJson", + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "required" : [ + "file" + ], + "type" : "object", + "properties" : { + "file" : { + "type" : "string", + "format" : "binary" + } + } + } + } + } + }, + "responses" : { + "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" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "OK.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ImportResponse" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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" + } + } + } + }, + "201" : { + "description" : "Created." + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" + } + } + }, + "required" : true + }, + "responses" : { + "429" : { + "description" : "Too many requests.", + "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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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" + } + } + } + }, + "201" : { + "description" : "Created." + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-planned/{assetId}" : { + "get" : { + "tags" : [ + "AssetsAsPlanned" + ], + "summary" : "Get asset by id", + "description" : "The endpoint returns an asset filtered by id .", + "operationId" : "assetById", + "parameters" : [ + { + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "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 assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + }, + "patch" : { + "tags" : [ + "AssetsAsPlanned" + ], + "summary" : "Updates asset", + "description" : "The endpoint updates asset by provided quality type.", + "operationId" : "updateAsset", + "parameters" : [ + { + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateAssetRequest" + } + } + }, + "required" : true + }, + "responses" : { + "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" + } + } + } + }, + "404" : { + "description" : "Not found.", + "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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" : [ + { + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "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 assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "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" + } + } + }, + "required" : true + }, + "responses" : { + "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 updated asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/registry/reload" : { + "get" : { + "tags" : [ + "Registry" + ], + "summary" : "Triggers reload of shell descriptors", + "description" : "The endpoint Triggers reload of shell descriptors.", + "operationId" : "reload", + "responses" : { + "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" + } + } + } + }, + "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" + } + } + } + }, + "202" : { + "description" : "Created registry reload job." + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/policies" : { + "get" : { + "tags" : [ + "Policies" + ], + "summary" : "Get all policies ", + "description" : "The endpoint returns all policies .", + "operationId" : "policy", + "responses" : { + "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" + } + } + } + }, + "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 policies", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PolicyResponse" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/notifications/{notificationId}" : { + "get" : { + "tags" : [ + "Notifications" + ], + "operationId" : "getAlert", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Notifications", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationResponse" + } + } + } + } + } + } + } + }, + "/notifications/distinctFilterValues" : { + "get" : { + "tags" : [ + "Notifications" + ], + "operationId" : "distinctFilterValues", + "parameters" : [ + { + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "size", + "in" : "query", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, + { + "name" : "startWith", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "channel", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string", + "enum" : [ + "SENDER", + "RECEIVER" + ] + } + } + ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + } + } + } + }, + "/dashboard" : { + "get" : { + "tags" : [ + "Dashboard" + ], + "summary" : "Returns dashboard related data", + "description" : "The endpoint can return limited data based on the user role", + "operationId" : "dashboard", + "responses" : { + "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" + } + } + } + }, + "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 dashboard data", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/DashboardResponse" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/import/report/{importJobId}" : { + "get" : { + "tags" : [ + "ImportReport", + "AssetsImport" + ], + "summary" : "report of the imported assets", + "description" : "This endpoint returns information about the imported assets to Trace-X.", + "operationId" : "importReport", + "parameters" : [ + { + "name" : "importJobId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "OK.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ImportReportResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "500" : { + "description" : "Internal server error.", + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-planned" : { + "get" : { + "tags" : [ + "AssetsAsPlanned" + ], + "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" : "filter", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + } + } + ], + "responses" : { + "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" + } + } + } + }, + "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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" : [ + { + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "size", + "in" : "query", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, + { + "name" : "startWith", + "in" : "query", + "required" : false, + "schema" : { + "type" : "string" + } + }, + { + "name" : "owner", + "in" : "query", + "required" : false, + "schema" : { + "type" : "string", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + } + } + ], + "responses" : { + "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" + } + } + } + }, + "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 a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-planned/*/children/{childId}" : { + "get" : { + "tags" : [ + "AssetsAsPlanned" + ], + "summary" : "Get asset by child id", + "description" : "The endpoint returns an asset filtered by child id.", + "operationId" : "assetByChildIdAndAssetId", + "parameters" : [ + { + "name" : "childId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "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" + } + } + } + }, + "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 asset by childId", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-built" : { + "get" : { + "tags" : [ + "AssetsAsBuilt" + ], + "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" : "searchCriteriaRequestParam", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + } + } + ], + "responses" : { + "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 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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" : [ + { + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "size", + "in" : "query", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, + { + "name" : "startWith", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "owner", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + } + } + ], + "responses" : { + "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" + } + } + } + }, + "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 a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/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" : { + "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" + } + } + } + }, + "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 assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/assets/as-built/*/children/{childId}" : { + "get" : { + "tags" : [ + "AssetsAsBuilt" + ], + "summary" : "Get asset by child id", + "description" : "The endpoint returns an asset filtered by child id.", + "operationId" : "assetByChildId", + "parameters" : [ + { + "name" : "childId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } + ], + "responses" : { + "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", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + }, + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "NO-246880451848384868750731" + }, + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "owner" : { + "type" : "string", + "example" : "CUSTOMER", + "enum" : [ + "SUPPLIER", + "CUSTOMER", + "OWN", + "UNKNOWN" + ] + }, + "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" + } + }, + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + }, + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "OMAYSKEITUGNVHKKX" + }, + "semanticDataModel" : { + "type" : "string", + "example" : "BATCH", + "enum" : [ + "BATCH", + "SERIALPART", + "UNKNOWN", + "PARTASPLANNED", + "JUSTINSEQUENCE", + "TOMBSTONEASBUILT", + "TOMBSTONEASPLANNED" + ] + }, + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "component" + }, + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" + } + }, + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "example" : 1, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + }, + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "example" : 2, + "items" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + }, + "importState" : { + "type" : "string", + "example" : "TRANSIENT", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/submodel/data" : { + "delete" : { + "tags" : [ + "Submodel" + ], + "summary" : "Delete All Submodels", + "description" : "Deletes all submodels from the system.", + "operationId" : "deleteSubmodels", + "responses" : { + "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" : "Ok." + }, + "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" + } + } + } + }, + "204" : { + "description" : "No Content." + }, + "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" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/bpn-config/{bpn}" : { + "delete" : { + "tags" : [ + "BpnEdcMapping" + ], + "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" + } + } + ], + "responses" : { + "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" + } + } + } + }, + "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" : "Okay" + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "Deleted." + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + } + }, + "components" : { + "schemas" : { + "BpnMappingRequest" : { + "required" : [ + "bpn", + "url" + ], + "type" : "object", + "properties" : { + "bpn" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "url" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + } + } + }, + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "maxLength" : 1000, + "minLength" : 0, + "pattern" : "^.*$", + "type" : "string", + "example" : "Access Denied" + } + } + }, + "BpnEdcMappingResponse" : { + "type" : "object", + "properties" : { + "bpn" : { + "type" : "string", + "example" : "BPNL00000003CSGV" + }, + "url" : { + "type" : "string", + "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" + } + } + }, + "StartQualityNotificationRequest" : { + "required" : [ + "severity" + ], + "type" : "object", + "properties" : { + "partIds" : { + "maxLength" : 100, + "minLength" : 1, + "maxItems" : 50, + "minItems" : 1, + "type" : "array", + "example" : [ + "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978" + ], + "items" : { + "maxLength" : 100, + "minLength" : 1, + "type" : "string", + "example" : "[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]" + } + }, + "description" : { + "maxLength" : 1000, + "minLength" : 15, + "type" : "string", + "example" : "The description" + }, + "targetDate" : { + "type" : "string", + "format" : "date-time", + "example" : "2099-03-11T22:44:06.333826952Z" + }, + "severity" : { + "type" : "string", + "enum" : [ + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE-THREATENING" + ] + }, + "receiverBpn" : { + "type" : "string", + "example" : "BPN00001123123AS" + }, + "type" : { + "type" : "string", + "example" : "ALERT", + "enum" : [ + "ALERT", + "INVESTIGATION" + ] + }, + "asBuilt" : { + "type" : "boolean" + } + } + }, + "QualityNotificationIdResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + } + } + }, + "UpdateQualityNotificationRequest" : { + "required" : [ + "status" + ], + "type" : "object", + "properties" : { + "status" : { + "type" : "string", + "description" : "The UpdateInvestigationStatus", + "enum" : [ + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED" + ] + }, + "reason" : { + "type" : "string", + "example" : "The reason." + } + } + }, + "CloseQualityNotificationRequest" : { + "type" : "object", + "properties" : { + "reason" : { + "maxLength" : 1000, + "minLength" : 15, + "type" : "string", + "example" : "The reason." + } + } + }, + "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" + } + } + } + }, + "PageableFilterRequest" : { + "type" : "object", + "properties" : { + "pageAble" : { + "$ref" : "#/components/schemas/OwnPageable" + }, + "searchCriteria" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" + } + } + }, + "SearchCriteriaRequestParam" : { + "type" : "object", + "properties" : { + "filter" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Filter Criteria", + "example" : "owner,EQUAL,OWN", + "items" : { + "type" : "string" + } + } + } + }, + "PageResultQualityNotificationResponse" : { + "type" : "object", + "properties" : { + "content" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "Content of PageResults", + "items" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Notifications", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationResponse" + } + } + }, + "page" : { + "type" : "integer", + "format" : "int32", + "example" : 1 + }, + "pageCount" : { + "type" : "integer", + "format" : "int32", + "example" : 15 + }, + "pageSize" : { + "type" : "integer", + "format" : "int32", + "example" : 10 + }, + "totalItems" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + } + }, + "QualityNotificationMessageResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "createdBy" : { + "type" : "string" + }, + "createdByName" : { + "type" : "string" + }, + "sendTo" : { + "type" : "string" + }, + "sendToName" : { + "type" : "string" + }, + "contractAgreementId" : { + "type" : "string" + }, + "notificationReferenceId" : { + "type" : "string" + }, + "targetDate" : { + "type" : "string", + "format" : "date-time" + }, + "severity" : { + "type" : "string", + "enum" : [ + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE-THREATENING" + ] + }, + "edcNotificationId" : { + "type" : "string" + }, + "created" : { + "type" : "string", + "format" : "date-time" + }, + "updated" : { + "type" : "string", + "format" : "date-time" + }, + "messageId" : { + "type" : "string" + }, + "status" : { + "type" : "string", + "enum" : [ + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + ] + }, + "errorMessage" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "EDC not reachable" + } + } + }, + "QualityNotificationReasonResponse" : { + "type" : "object", + "properties" : { + "close" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string", + "example" : "description of closing reason" + }, + "accept" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string", + "example" : "description of accepting reason" + }, + "decline" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string", + "example" : "description of declining reason" + } + } + }, + "QualityNotificationResponse" : { + "type" : "object", + "properties" : { + "id" : { + "maximum" : 255, + "minimum" : 0, + "maxLength" : 255, + "type" : "integer", + "format" : "int64", + "example" : 66 + }, + "status" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "CREATED", + "enum" : [ + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + ] + }, + "description" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string", + "example" : "DescriptionText" + }, + "createdBy" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003AYRE" + }, + "createdByName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "createdDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "2023-02-21T21:27:10.734950Z" + }, + "assetIds" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "example" : [ + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" + ], + "items" : { + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" + } + }, + "channel" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "SENDER", + "enum" : [ + "SENDER", + "RECEIVER" + ] + }, + "reason" : { + "$ref" : "#/components/schemas/QualityNotificationReasonResponse" + }, + "sendTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003AYRE" + }, + "sendToName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "severity" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "MINOR", + "enum" : [ + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE-THREATENING" + ] + }, + "type" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "ALERT", + "enum" : [ + "ALERT", + "INVESTIGATION" + ] + }, + "targetDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "2099-02-21T21:27:10.734950Z" + }, + "messages" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } + } + } + }, + "CreateNotificationContractRequest" : { + "required" : [ + "notificationMethod", + "notificationType" + ], + "type" : "object", + "properties" : { + "notificationType" : { + "type" : "string", + "enum" : [ + "QUALITY_INVESTIGATION", + "QUALITY_ALERT" + ] + }, + "notificationMethod" : { + "type" : "string", + "enum" : [ + "RECEIVE", + "UPDATE", + "RESOLVE" + ] + } + } + }, + "CreateNotificationContractResponse" : { + "type" : "object", + "properties" : { + "notificationAssetId" : { + "type" : "string", + "example" : "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + }, + "accessPolicyId" : { + "type" : "string", + "example" : "123" + }, + "contractDefinitionId" : { + "type" : "string", + "example" : "456" + } + } + }, + "ContractResponse" : { + "type" : "object", + "properties" : { + "contractId" : { + "maxLength" : 255, + "type" : "string", + "example" : "66" + }, + "counterpartyAddress" : { + "maxLength" : 255, + "type" : "string", + "example" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp" + }, + "creationDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "endDate" : { + "maxLength" : 255, + "type" : "string", + "format" : "date-time", + "example" : "2023-02-21T21:27:10.73495Z" + }, + "state" : { + "maxLength" : 255, + "type" : "string", + "example" : "FINALIZED" + }, + "policy" : { + "maxLength" : 255, + "type" : "string", + "example" : "{\\\"@id\\\":\\\"eb0c8486-914a-4d36-84c0-b4971cbc52e4\\\",\\\"@type\\\":\\\"odrl:Set\\\",\\\"odrl:permission\\\":{\\\"odrl:target\\\":\\\"registry-asset\\\",\\\"odrl:action\\\":{\\\"odrl:type\\\":\\\"USE\\\"},\\\"odrl:constraint\\\":{\\\"odrl:or\\\":{\\\"odrl:leftOperand\\\":\\\"PURPOSE\\\",\\\"odrl:operator\\\":{\\\"@id\\\":\\\"odrl:eq\\\"},\\\"odrl:rightOperand\\\":\\\"ID 3.0 Trace\\\"}}},\\\"odrl:prohibition\\\":[],\\\"odrl:obligation\\\":[],\\\"odrl:target\\\":\\\"registry-asset\\\"}" + } + } + }, + "PageResultContractResponse" : { + "type" : "object", + "properties" : { + "content" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "Content of PageResults", + "items" : { + "$ref" : "#/components/schemas/ContractResponse" + } + }, + "page" : { + "type" : "integer", + "format" : "int32", + "example" : 1 + }, + "pageCount" : { + "type" : "integer", + "format" : "int32", + "example" : 15 + }, + "pageSize" : { + "type" : "integer", + "format" : "int32", + "example" : 10 + }, + "totalItems" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + } + }, + "RegisterAssetRequest" : { + "required" : [ + "assetIds", + "policyId" + ], + "type" : "object", + "properties" : { + "policyId" : { + "type" : "string", + "example" : "a644a7cb-3de5-493b-9259-f01db315a46e" + }, + "assetIds" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "ImportResponse" : { + "type" : "object", + "properties" : { + "jobId" : { + "type" : "string" + }, + "importStateMessage" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ImportStateMessage" + } + }, + "validationResult" : { + "$ref" : "#/components/schemas/ValidationResponse" + } + } + }, + "ImportStateMessage" : { + "type" : "object", + "properties" : { + "catenaXId" : { + "type" : "string" + }, + "persistedOrUpdated" : { + "type" : "boolean" + } + } + }, + "ValidationResponse" : { + "type" : "object", + "properties" : { + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "SyncAssetsRequest" : { + "type" : "object", + "properties" : { + "globalAssetIds" : { + "maxItems" : 100, + "minItems" : 1, + "type" : "array", + "example" : [ + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + ], + "items" : { + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]" + } + } + } + }, + "GetDetailInformationRequest" : { + "type" : "object", + "properties" : { + "assetIds" : { + "maxLength" : 50, + "minLength" : 1, + "maxItems" : 50, + "minItems" : 1, + "type" : "array", + "example" : [ + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd" + ], + "items" : { + "maxLength" : 50, + "minLength" : 1, + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\"]" + } + } + } + }, + "DescriptionsResponse" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "urn:uuid:a4a26b9c-9460-4cc5-8645-85916b86adb0" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "assembly-part-relationship" + } + } + }, + "DetailAspectDataAsBuiltResponse" : { + "type" : "object", + "properties" : { + "partId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "95657762-59" + }, + "customerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "01697F7-65" + }, + "nameAtCustomer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Door front-left" + }, + "manufacturingCountry" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "DEU" + }, + "manufacturingDate" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "2022-02-04T13:48:54Z" + } + } + }, + "DetailAspectDataAsPlannedResponse" : { + "type" : "object", + "properties" : { + "validityPeriodFrom" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "2022-09-26T12:43:51.079Z" + }, + "validityPeriodTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "20232-07-13T12:00:00.000Z" + } + } + }, + "DetailAspectDataResponse" : { + "type" : "object", + "oneOf" : [ + { + "$ref" : "#/components/schemas/DetailAspectDataAsBuiltResponse" + }, + { + "$ref" : "#/components/schemas/DetailAspectDataAsPlannedResponse" + }, + { + "$ref" : "#/components/schemas/PartSiteInformationAsPlannedResponse" + }, + { + "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" + } + ] + }, + "DetailAspectDataTractionBatteryCodeResponse" : { + "type" : "object", + "properties" : { + "productType" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "pack" + }, + "tractionBatteryCode" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "X12MCPM27KLPCLX2M2382320" + }, + "subcomponents" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" + } + } + } + }, + "DetailAspectDataTractionBatteryCodeSubcomponentResponse" : { + "type" : "object", + "properties" : { + "productType" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "pack" + }, + "tractionBatteryCode" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "X12MCPM27KLPCLX2M2382320" + } + } + }, + "DetailAspectModelResponse" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string", + "example" : "PART_SITE_INFORMATION_AS_PLANNED", + "enum" : [ + "AS_BUILT", + "AS_PLANNED", + "TRACTION_BATTERY_CODE", + "SINGLE_LEVEL_BOM_AS_BUILT", + "SINGLE_LEVEL_USAGE_AS_BUILT", + "SINGLE_LEVEL_BOM_AS_PLANNED", + "PART_SITE_INFORMATION_AS_PLANNED" + ] + }, + "data" : { + "$ref" : "#/components/schemas/DetailAspectDataResponse" + } + } + }, + "PartSiteInformationAsPlannedResponse" : { + "type" : "object", + "properties" : { + "functionValidUntil" : { + "type" : "string", + "example" : "2025-02-08T04:30:48.000Z" + }, + "function" : { + "type" : "string", + "example" : "production" + }, + "functionValidFrom" : { + "type" : "string", + "example" : "2023-10-13T14:30:45+01:00" + }, + "catenaXSiteId" : { + "type" : "string", + "example" : "urn:uuid:0fed587c-7ab4-4597-9841-1718e9693003" + } + } + }, + "UpdateAssetRequest" : { + "required" : [ + "qualityType" + ], + "type" : "object", + "properties" : { + "qualityType" : { + "type" : "string", + "example" : "Ok", + "enum" : [ + "Ok", + "Minor", + "Major", + "Critical", + "LifeThreatening" + ] + } + } + }, + "ConstraintResponse" : { + "type" : "object", + "properties" : { + "leftOperand" : { + "type" : "string", + "example" : "PURPOSE" + }, + "operatorTypeResponse" : { + "type" : "string", + "enum" : [ + "EQ", + "NEQ", + "LT", + "GT", + "IN", + "LTEQ", + "GTEQ", + "ISA", + "HASPART", + "ISPARTOF", + "ISONEOF", + "ISALLOF", + "ISNONEOF" + ] + }, + "rightOperand" : { + "type" : "string", + "example" : "ID Trace 3.1" + } + } + }, + "ConstraintsResponse" : { + "type" : "object", + "properties" : { + "and" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConstraintResponse" + } + }, + "or" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ConstraintResponse" + } + } + } + }, + "PermissionResponse" : { + "type" : "object", + "properties" : { + "action" : { + "type" : "string", + "example" : "USE", + "enum" : [ + "ACCESS", + "USE" + ] + }, + "constraints" : { + "$ref" : "#/components/schemas/ConstraintsResponse" + } + } + }, + "PolicyResponse" : { + "type" : "object", + "properties" : { + "policyId" : { + "type" : "string", + "example" : "5a00bb50-0253-405f-b9f1-1a3150b9d51d" + }, + "createdOn" : { + "type" : "string", + "format" : "date-time" + }, + "validUntil" : { + "type" : "string", + "format" : "date-time" + }, + "permissions" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PermissionResponse" + } + } + } + }, + "DashboardResponse" : { + "type" : "object", + "properties" : { + "asBuiltCustomerParts" : { + "type" : "integer", + "format" : "int64", + "example" : 5 + }, + "asPlannedCustomerParts" : { + "type" : "integer", + "format" : "int64", + "example" : 10 + }, + "asBuiltSupplierParts" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "asPlannedSupplierParts" : { + "type" : "integer", + "format" : "int64", + "example" : 3 + }, + "asBuiltOwnParts" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "asPlannedOwnParts" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "myPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "myPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "supplierPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "customerPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64", + "example" : 1 + }, + "supplierPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "customerPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "receivedActiveAlerts" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "receivedActiveInvestigations" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "sentActiveAlerts" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + }, + "sentActiveInvestigations" : { + "type" : "integer", + "format" : "int64", + "example" : 2 + } + } + }, + "ImportJobResponse" : { + "type" : "object", + "properties" : { + "importJobStatus" : { + "type" : "string", + "enum" : [ + "INITIALIZING", + "RUNNING", + "ERROR", + "COMPLETED" + ] + }, + "importId" : { + "type" : "string", + "example" : "456a952e-05eb-40dc-a6f2-9c2cb9c1387f" + }, + "startedOn" : { + "maxLength" : 50, + "type" : "string", + "example" : "2099-02-21T21:27:10.734950Z" + }, + "completedOn" : { + "maxLength" : 50, + "type" : "string", + "example" : "2099-02-21T21:27:10.734950Z" + } + } + }, + "ImportReportResponse" : { + "type" : "object", + "properties" : { + "importJob" : { + "$ref" : "#/components/schemas/ImportJobResponse" + }, + "importedAsset" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ImportedAssetResponse" + } + } + } + }, + "ImportedAssetResponse" : { + "type" : "object", + "properties" : { + "importState" : { + "type" : "string", + "enum" : [ + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "catenaxId" : { + "type" : "string", + "example" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd}" + }, + "importedOn" : { + "maxLength" : 50, + "type" : "string", + "example" : "2099-02-21T21:27:10.734950Z" + }, + "importMessage" : { + "type" : "string", + "example" : "Asset created successfully in transient state." + } + } + } + }, + "securitySchemes" : { + "oAuth2" : { + "type" : "oauth2", + "flows" : { + "clientCredentials" : { + "tokenUrl" : "https://example.com/api/oauth/token", + "scopes" : { + "profile email" : "" + } + } + } + } + } + } +} 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 deleted file mode 100644 index caea1f095a..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java +++ /dev/null @@ -1,591 +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.qualitynotification.application.alert.rest; - -import assets.importpoc.ErrorResponse; -import io.swagger.annotations.ApiParam; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.ws.rs.QueryParam; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.request.OwnPageable; -import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; -import org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper.AlertResponseMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.http.HttpStatus; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; -import qualitynotification.alert.response.AlertResponse; -import qualitynotification.base.request.CloseQualityNotificationRequest; -import qualitynotification.base.request.QualityNotificationStatusRequest; -import qualitynotification.base.request.StartQualityNotificationRequest; -import qualitynotification.base.request.UpdateQualityNotificationRequest; -import qualitynotification.base.response.QualityNotificationIdResponse; - -import java.util.List; - -import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; -import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus.from; - - -@RestController -@RequestMapping(value = "/alerts", consumes = "application/json", produces = "application/json") -@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SUPERVISOR', 'ROLE_USER')") -@Tag(name = "Alerts") -@Validated -@Slf4j -public class AlertController { - - private final QualityNotificationService alertService; - - // TODO move to QualityNotificationService - private final BaseRequestFieldMapper fieldMapper; - - public AlertController( - @Qualifier("notificationServiceImpl") QualityNotificationService alertService, - QualityNotificationFieldMapper fieldMapper) { - this.alertService = alertService; - this.fieldMapper = fieldMapper; - } - - private static final String API_LOG_START = "Received API call on /alerts"; - - @Operation(operationId = "alertAssets", - summary = "Start alert by part ids", - tags = {"Alerts"}, - description = "The endpoint starts alert based on part ids provided.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Created."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @ResponseStatus(HttpStatus.CREATED) - public QualityNotificationIdResponse alertAssets(@RequestBody @Valid StartQualityNotificationRequest request) { - StartQualityNotificationRequest cleanStartQualityNotificationRequest = sanitize(request); - log.info(API_LOG_START + " with params: {}", cleanStartQualityNotificationRequest); - return new QualityNotificationIdResponse(alertService.start(from(cleanStartQualityNotificationRequest)).value()); - } - - @Operation(operationId = "filterAlerts", - summary = "Filter alerts defined by the request body", - tags = {"Alerts"}, - description = "The endpoint returns alerts as paged result.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns the paged result found for Asset", content = @Content( - mediaType = "application/json", - array = @ArraySchema(arraySchema = @Schema(description = "AlertData", implementation = AlertResponse.class, additionalProperties = Schema.AdditionalPropertiesValue.FALSE), maxItems = Integer.MAX_VALUE), - schema = @Schema(implementation = AlertResponse.class) - )), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/filter") - public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { - log.info(API_LOG_START); - return AlertResponseMapper.fromAsPageResult( - alertService.getNotifications( - OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), fieldMapper), - pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(fieldMapper))); - } - - @Operation(operationId = "getAlert", - summary = "Gets Alert by id", - tags = {"Alerts"}, - description = "The endpoint returns alert by id.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @GetMapping("/{alertId}") - public AlertResponse getAlert(@PathVariable("alertId") Long alertId) { - log.info(API_LOG_START + "/{}", alertId); - return AlertResponseMapper.from(alertService.find(alertId)); - } - - @Operation(operationId = "approveAlert", - summary = "Approves alert by id", - tags = {"Alerts"}, - 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."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/{alertId}/approve") - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void approveAlert(@PathVariable("alertId") Long alertId) { - log.info(API_LOG_START + "/{}/approve", alertId); - alertService.approve(alertId); - } - - @Operation(operationId = "cancelAlert", - summary = "Cancels alert by id", - tags = {"Alerts"}, - 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."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/{alertId}/cancel") - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void cancelAlert(@PathVariable("alertId") Long alertId) { - log.info(API_LOG_START + "/{}/cancel", alertId); - alertService.cancel(alertId); - } - - @Operation(operationId = "closeAlert", - summary = "Close alert by id", - tags = {"Alerts"}, - 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.", - content = @Content()), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") - @PostMapping("/{alertId}/close") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void closeAlert( - @PathVariable("alertId") @ApiParam Long alertId, - @Valid @RequestBody CloseQualityNotificationRequest closeAlertRequest) { - CloseQualityNotificationRequest cleanCloseAlertRequest = sanitize(closeAlertRequest); - log.info(API_LOG_START + "/{}/close with params {}", alertId, cleanCloseAlertRequest); - alertService.update(alertId, from(QualityNotificationStatusRequest.CLOSED), cleanCloseAlertRequest.getReason()); - } - - @Operation(operationId = "updateAlert", - summary = "Update alert by id", - tags = {"Alerts"}, - description = "The endpoint updates alert by their id.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = { - @ApiResponse( - responseCode = "204", - description = "No content.", - content = @Content()), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @PostMapping("/{alertId}/update") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void updateAlert( - @PathVariable("alertId") Long alertId, - @Valid @RequestBody UpdateQualityNotificationRequest updateAlertRequest) { - UpdateQualityNotificationRequest cleanUpdateAlertRequest = sanitize(updateAlertRequest); - validate(cleanUpdateAlertRequest); - log.info(API_LOG_START + "/{}/update with params {}", alertId, cleanUpdateAlertRequest); - alertService.update(alertId, from(cleanUpdateAlertRequest.getStatus()), cleanUpdateAlertRequest.getReason()); - } - - @Operation(operationId = "distinctFilterValues", - summary = "getDistinctFilterValues", - tags = {"Assets"}, - description = "The endpoint returns a distinct filter values for given fieldName.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns a distinct filter values for given fieldName.", content = @Content( - mediaType = "application/json", - array = @ArraySchema( - schema = @Schema( - description = "FilterValues", - implementation = String.class, - additionalProperties = Schema.AdditionalPropertiesValue.FALSE - ), - maxItems = Integer.MAX_VALUE, - minItems = 0) - )), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @GetMapping("distinctFilterValues") - public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { - return alertService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); - } -} - diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java deleted file mode 100644 index deed9979fb..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/mapper/InvestigationResponseMapper.java +++ /dev/null @@ -1,106 +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.qualitynotification.application.investigation.mapper; - -import lombok.experimental.UtilityClass; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import qualitynotification.base.response.QualityNotificationReasonResponse; -import qualitynotification.investigation.response.InvestigationResponse; - -import java.time.Instant; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import static org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper.fromNotifications; - -@UtilityClass -public class InvestigationResponseMapper { - - public static InvestigationResponse from(QualityNotification qualityNotification) { - return InvestigationResponse - .builder() - .id(qualityNotification.getNotificationId().value()) - .status(QualityNotificationMapper.from(qualityNotification.getNotificationStatus())) - .description(qualityNotification.getDescription()) - .createdBy(getSenderBPN(qualityNotification.getNotifications())) - .createdByName(getSenderName(qualityNotification.getNotifications())) - .createdDate(qualityNotification.getCreatedAt().toString()) - .assetIds(Collections.unmodifiableList(qualityNotification.getAssetIds())) - .channel(QualityNotificationMapper.from(qualityNotification.getNotificationSide())) - .reason(new QualityNotificationReasonResponse( - qualityNotification.getCloseReason(), - qualityNotification.getAcceptReason(), - qualityNotification.getDeclineReason() - )) - .sendTo(getReceiverBPN(qualityNotification.getNotifications())) - .sendToName(getReceiverName(qualityNotification.getNotifications())) - .severity(QualityNotificationMapper.from(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getSeverity).orElse(QualityNotificationSeverity.MINOR))) - .targetDate(qualityNotification.getNotifications().stream().findFirst().map(QualityNotificationMessage::getTargetDate).map(Instant::toString).orElse(null)) - .messages(fromNotifications(qualityNotification.getNotifications())) - .build(); - } - - public static PageResult fromAsPageResult(PageResult qualityNotificationPageResult) { - List investigationResponses = qualityNotificationPageResult.content().stream().map(InvestigationResponseMapper::from).toList(); - int pageNumber = qualityNotificationPageResult.page(); - int pageSize = qualityNotificationPageResult.pageSize(); - Pageable pageable = PageRequest.of(pageNumber, pageSize); - - Page investigationDataPage = new PageImpl<>(investigationResponses, pageable, qualityNotificationPageResult.totalItems()); - return new PageResult<>(investigationDataPage); - } - - private static String getSenderBPN(Collection notifications) { - return notifications.stream() - .findFirst() - .map(QualityNotificationMessage::getCreatedBy) - .orElse(null); - } - - private static String getReceiverBPN(Collection notifications) { - return notifications.stream() - .findFirst() - .map(QualityNotificationMessage::getSendTo) - .orElse(null); - } - - private static String getSenderName(Collection notifications) { - return notifications.stream() - .findFirst() - .map(QualityNotificationMessage::getCreatedByName) - .orElse(null); - } - - private static String getReceiverName(Collection notifications) { - return notifications.stream() - .findFirst() - .map(QualityNotificationMessage::getSendToName) - .orElse(null); - } -} 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 deleted file mode 100644 index 7564d12604..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java +++ /dev/null @@ -1,584 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.application.investigation.rest; - - -import assets.importpoc.ErrorResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import jakarta.ws.rs.QueryParam; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; -import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.common.request.OwnPageable; -import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.application.investigation.mapper.InvestigationResponseMapper; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.http.HttpStatus; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; -import qualitynotification.base.request.CloseQualityNotificationRequest; -import qualitynotification.base.request.QualityNotificationStatusRequest; -import qualitynotification.base.request.StartQualityNotificationRequest; -import qualitynotification.base.request.UpdateQualityNotificationRequest; -import qualitynotification.base.response.QualityNotificationIdResponse; -import qualitynotification.investigation.response.InvestigationResponse; - -import java.util.List; - -import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; -import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus.from; - -@RestController -@RequestMapping(value = "/investigations", consumes = "application/json", produces = "application/json") -@PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_SUPERVISOR', 'ROLE_USER')") -@Tag(name = "Investigations", description = "Operations on Investigation Notification") -@Validated -@Slf4j -public class InvestigationsController { - - private final QualityNotificationService investigationService; - - // TODO move to QualityNotificationService - private final BaseRequestFieldMapper fieldMapper; - - public InvestigationsController( - @Qualifier("notificationServiceImpl") QualityNotificationService investigationService, - QualityNotificationFieldMapper fieldMapper) { - this.investigationService = investigationService; - this.fieldMapper = fieldMapper; - } - - private static final String API_LOG_START = "Received API call on /investigations"; - - @Operation(operationId = "investigateAssets", - summary = "Start investigations by part ids", - tags = {"Investigations"}, - description = "The endpoint starts investigations based on part ids provided.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Created."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @ResponseStatus(HttpStatus.CREATED) - public QualityNotificationIdResponse investigateAssets(@RequestBody @Valid StartQualityNotificationRequest request) { - StartQualityNotificationRequest cleanRequest = sanitize(request); - log.info(API_LOG_START + " with params: {}", cleanRequest); - return new QualityNotificationIdResponse(investigationService.start(from(cleanRequest)).value()); - } - - @Operation(operationId = "filterInvestigations", - summary = "Filter investigations defined by the request body", - tags = {"Investigations"}, - description = "The endpoint returns investigations as paged result.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns the paged result found for Asset", content = @Content( - mediaType = "application/json", - array = @ArraySchema(schema = @Schema(description = "InvestigationData", implementation = InvestigationResponse.class, additionalProperties = Schema.AdditionalPropertiesValue.FALSE), minItems = 0, maxItems = Integer.MAX_VALUE) - )), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/filter") - public PageResult getInvestigations(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { - log.info(API_LOG_START); - return InvestigationResponseMapper.fromAsPageResult( - investigationService.getNotifications( - OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), fieldMapper), - pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(fieldMapper))); - } - - @Operation(operationId = "getInvestigation", - summary = "Gets investigations by id", - tags = {"Investigations"}, - description = "The endpoint returns investigations as paged result by their id.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @GetMapping("/{investigationId}") - public InvestigationResponse getInvestigation(@PathVariable("investigationId") Long investigationId) { - log.info(API_LOG_START + "/{}", investigationId); - return InvestigationResponseMapper.from(investigationService.find(investigationId)); - } - - @Operation(operationId = "approveInvestigation", - summary = "Approves investigations by id", - tags = {"Investigations"}, - 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."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/{investigationId}/approve") - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void approveInvestigation(@PathVariable("investigationId") Long investigationId) { - log.info(API_LOG_START + "/{}/approve", investigationId); - investigationService.approve(investigationId); - } - - @Operation(operationId = "cancelInvestigation", - summary = "Cancles investigations by id", - tags = {"Investigations"}, - 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."), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PostMapping("/{investigationId}/cancel") - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void cancelInvestigation(@PathVariable("investigationId") Long investigationId) { - log.info(API_LOG_START + "/{}/cancel", investigationId); - investigationService.cancel(investigationId); - } - - @Operation(operationId = "closeInvestigation", - summary = "Close investigations by id", - tags = {"Investigations"}, - 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.", - content = @Content()), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") - @PostMapping("/{investigationId}/close") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void closeInvestigation(@PathVariable("investigationId") Long investigationId, @Valid @RequestBody CloseQualityNotificationRequest closeInvestigationRequest) { - CloseQualityNotificationRequest cleanCloseQualityNotificationRequest = sanitize(closeInvestigationRequest); - log.info(API_LOG_START + "/{}/close with params {}", investigationId, cleanCloseQualityNotificationRequest); - investigationService.update(investigationId, from(QualityNotificationStatusRequest.CLOSED), cleanCloseQualityNotificationRequest.getReason()); - } - - @Operation(operationId = "updateInvestigation", - summary = "Update investigations by id", - tags = {"Investigations"}, - 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.", - content = @Content()), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") - @PostMapping("/{investigationId}/update") - @ResponseStatus(HttpStatus.NO_CONTENT) - public void updateInvestigation(@PathVariable("investigationId") Long investigationId, @Valid @RequestBody UpdateQualityNotificationRequest updateInvestigationRequest) { - UpdateQualityNotificationRequest cleanUpdateQualityNotificationRequest = sanitize(updateInvestigationRequest); - validate(cleanUpdateQualityNotificationRequest); - log.info(API_LOG_START + "/{}/update with params {}", investigationId, cleanUpdateQualityNotificationRequest); - investigationService.update(investigationId, from(cleanUpdateQualityNotificationRequest.getStatus()), cleanUpdateQualityNotificationRequest.getReason()); - } - - - @Operation(operationId = "distinctFilterValues", - summary = "getDistinctFilterValues", - tags = {"Assets"}, - description = "The endpoint returns a distinct filter values for given fieldName.", - security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) - @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns a distinct filter values for given fieldName.", content = @Content( - mediaType = "application/json", - array = @ArraySchema( - schema = @Schema( - description = "FilterValues", - implementation = String.class, - additionalProperties = Schema.AdditionalPropertiesValue.FALSE - ), - maxItems = Integer.MAX_VALUE, - minItems = 0) - )), - @ApiResponse( - responseCode = "400", - description = "Bad request.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "401", - description = "Authorization failed.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - - @ApiResponse( - responseCode = "403", - description = "Forbidden.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "404", - description = "Not found.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "415", - description = "Unsupported media type", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "429", - description = "Too many requests.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class))), - @ApiResponse( - responseCode = "500", - description = "Internal server error.", - content = @Content( - mediaType = "application/json", - schema = @Schema(implementation = ErrorResponse.class)))}) - @GetMapping("distinctFilterValues") - public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { - return investigationService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); - } -} - diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java similarity index 84% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java index 7d4d1f33c0..e834877a0d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/mapper/AlertResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -17,11 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper; import lombok.experimental.UtilityClass; import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; @@ -29,21 +28,21 @@ import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import qualitynotification.alert.response.AlertResponse; import qualitynotification.base.response.QualityNotificationReasonResponse; +import qualitynotification.base.response.QualityNotificationResponse; import java.time.Instant; import java.util.Collection; import java.util.Collections; import java.util.List; -import static org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationMapper.fromNotifications; +import static org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.QualityNotificationMapper.fromNotifications; @UtilityClass -public class AlertResponseMapper { +public class NotificationResponseMapper { - public static AlertResponse from(QualityNotification qualityNotification) { - return AlertResponse + public static QualityNotificationResponse from(QualityNotification qualityNotification) { + return QualityNotificationResponse .builder() .id(qualityNotification.getNotificationId().value()) .status(QualityNotificationMapper.from(qualityNotification.getNotificationStatus())) @@ -66,13 +65,13 @@ public static AlertResponse from(QualityNotification qualityNotification) { .build(); } - public static PageResult fromAsPageResult(PageResult qualityNotificationPageResult) { - List investigationResponses = qualityNotificationPageResult.content().stream().map(AlertResponseMapper::from).toList(); + public static PageResult fromAsPageResult(PageResult qualityNotificationPageResult) { + List investigationResponses = qualityNotificationPageResult.content().stream().map(NotificationResponseMapper::from).toList(); int pageNumber = qualityNotificationPageResult.page(); int pageSize = qualityNotificationPageResult.pageSize(); Pageable pageable = PageRequest.of(pageNumber, pageSize); - Page investigationDataPage = new PageImpl<>(investigationResponses, pageable, qualityNotificationPageResult.totalItems()); + Page investigationDataPage = new PageImpl<>(investigationResponses, pageable, qualityNotificationPageResult.totalItems()); return new PageResult<>(investigationDataPage); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java similarity index 98% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java index 0f03fb8099..eaaf1eb5e8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper; import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; import org.springframework.stereotype.Component; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java similarity index 99% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java index 21ea434ab5..5aaf6add7f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper; import lombok.experimental.UtilityClass; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java index 79e60427d8..2e9a4bcc70 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java @@ -28,9 +28,9 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; -import org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper.AlertResponseMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.QualityNotificationFieldMapper; +import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.NotificationResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.springframework.beans.factory.annotation.Qualifier; @@ -44,12 +44,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; -import qualitynotification.alert.response.AlertResponse; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationStatusRequest; import qualitynotification.base.request.StartQualityNotificationRequest; import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.response.QualityNotificationIdResponse; +import qualitynotification.base.response.QualityNotificationResponse; import java.util.List; @@ -86,18 +86,18 @@ public QualityNotificationIdResponse alertAssets(@RequestBody @Valid StartQualit } @PostMapping("/filter") - public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { + public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { log.info("Received API call on /notifications/filter"); - return AlertResponseMapper.fromAsPageResult( + return NotificationResponseMapper.fromAsPageResult( notificationService.getNotifications( OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), fieldMapper), pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(fieldMapper))); } @GetMapping("/{notificationId}") - public AlertResponse getAlert(@PathVariable("notificationId") Long notificationId) { + public QualityNotificationResponse getAlert(@PathVariable("notificationId") Long notificationId) { log.info("Received API call on /notifications/" + "/{}", notificationId); - return AlertResponseMapper.from(notificationService.find(notificationId)); + return NotificationResponseMapper.from(notificationService.find(notificationId)); } @PostMapping("/{notificationId}/approve") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java similarity index 99% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java index 291d403a97..86a268493e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.base.service; +package org.eclipse.tractusx.traceability.qualitynotification.application.service; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 4390447f72..6c18fec439 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -23,7 +23,7 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java index 823c59b8ec..a97df9fe07 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java @@ -177,7 +177,7 @@ void givenPendingInvestigation_whenGetDashboard_thenReturnPendingInvestigation() .contentType(ContentType.JSON) .body(objectMapper.writeValueAsString(notificationRequest)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java index 98d06b41d8..6a47453e53 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java @@ -75,7 +75,7 @@ void givenAlerts_whenProvideNoFilter_thenReturnAll() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(Collections.emptyList()))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -96,7 +96,7 @@ void givenAlerts_whenProvideBpnFilter_thenReturnExpectedResult() throws JoseExce .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -124,7 +124,7 @@ void givenAlerts_whenProvideTooManyFilters_thenReturnError() throws JoseExceptio .when() .log() .uri() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .log().all() .statusCode(200) @@ -145,7 +145,7 @@ void givenAlerts_whenProvideBpnFilterAnd_thenReturnExpectedResult() throws JoseE .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -167,7 +167,7 @@ void givenAlerts_whenProvideDateRangeFilters_thenReturnExpectedResult() throws J .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -189,7 +189,7 @@ void givenAlerts_whenProvideDateRangeFiltersXAnd_thenReturnExpectedResult() thro .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -210,7 +210,7 @@ void givenNonExistingFilterField_whenGetAlerts_thenBadRequest() throws JoseExcep .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } @@ -228,7 +228,7 @@ void givenAlerts_whenInvalidLocalDate_thenReturnBadRequest() throws JoseExceptio .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } @@ -245,7 +245,7 @@ void givenAlerts_whenTargetDateAtLocalDate_thenExpectedResult() throws JoseExcep .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -265,7 +265,7 @@ void givenAlerts_whenProvideFilterWithSeverityCritical_thenReturnAllCritical() t .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("severity,EQUAL,CRITICAL,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -285,7 +285,7 @@ void givenAlerts_whenProvideFilterCreatedBy_thenReturnAllCritical() throws JoseE .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("createdBy,STARTS_WITH,BPNL00000001O,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -305,7 +305,7 @@ void givenAlerts_whenProvideFilterCreatedByName_thenReturnAllCritical() throws J .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("createdByName,STARTS_WITH,Car,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -326,7 +326,7 @@ void givenAlerts_whenProvideFilterSendTo_thenReturnExpectedResults() throws Jose .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -348,7 +348,7 @@ void givenAlerts_whenProvideFilterSendToSort_thenReturnExpectedResults() throws .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -381,7 +381,7 @@ void givenAlerts_whenGetAlertsByAssetId_thenReturnOnlyRelatedAlerts() throws Jos .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .log().all() .statusCode(200) @@ -401,7 +401,7 @@ void givenAlerts_whenProvideFilterLongerThan1100_thenReturnHttp400() throws Jose .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), searchCriteriaRequestParam)) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .log().all() .statusCode(400) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java index 994f128a68..d07333c16a 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java @@ -60,7 +60,7 @@ void givenDescriptionField_whenCallDistinctFilterValues_thenProperResponse() thr .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -86,7 +86,7 @@ void givenDescriptionFieldStartWith_whenCallDistinctFilterValues_thenProperRespo .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -113,7 +113,7 @@ void givenDescriptionFieldStartWithAndReceiver_whenCallDistinctFilterValues_then .param("size", size) .param("startWith", startWith) .param("channel", channel) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -140,7 +140,7 @@ void givenDescriptionFieldStartWithAndSender_whenCallDistinctFilterValues_thenPr .param("size", size) .param("startWith", startWith) .param("channel", channel) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -163,7 +163,7 @@ void givenBpnField_whenCallDistinctFilterValues_thenProperResponse() throws Jose .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -188,7 +188,7 @@ void givenBpnFieldStartWithCaseInsensitive1_whenCallDistinctFilterValues_thenPro .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -213,7 +213,7 @@ void givenBpnFieldStartWithCaseInsensitive2_whenCallDistinctFilterValues_thenPro .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -236,7 +236,7 @@ void givenCreatedDateField_whenCallDistinctFilterValues_thenProperResponse() thr .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -266,7 +266,7 @@ void givenCreatedDateFieldAndNoSize_whenCallDistinctFilterValues_thenProperRespo .log().all() .when() .param("fieldName", fieldName) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -298,7 +298,7 @@ void givenCreatedByField_whenCallDistinctFilterValues_thenProperResponse() throw .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -323,7 +323,7 @@ void givenCreatedByFieldAndSender_whenCallDistinctFilterValues_thenProperRespons .param("fieldName", fieldName) .param("size", size) .param("channel", channel) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -348,7 +348,7 @@ void givenCreatedByFieldAndReceiver_whenCallDistinctFilterValues_thenProperRespo .param("fieldName", fieldName) .param("size", size) .param("channel", channel) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -370,7 +370,7 @@ void givenEnumTypeFields_whenCallDistinctFilterValues_thenProperResponse( .when() .param("fieldName", fieldName) .param("size", resultLimit.toString()) - .get("/api/alerts/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java index 046f59b61e..34b588d683 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java @@ -147,7 +147,7 @@ void shouldStartAlert() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(201) .body("id", Matchers.isA(Number.class)); @@ -167,7 +167,7 @@ void shouldStartAlert() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -195,7 +195,7 @@ void givenMissingSeverity_whenStartAlert_thenBadRequest() throws JsonProcessingE .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(400); } @@ -224,7 +224,7 @@ void givenDescriptionOverMaxLength_whenStartAlert_thenBadRequest() throws JsonPr .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(400) .body(Matchers.containsString("Description should have at least 15 characters and at most 1000 characters")); @@ -247,7 +247,7 @@ void givenTooLongAlertReason_whenUpdateAlert_thenBadRequest() throws JsonProcess .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(JwtRole.SUPERVISOR)) .when() - .post("/api/alerts/1/update") + .post("/api/notifications/1/update") .then() .statusCode(400) .body(Matchers.containsString("Reason should have at least 15 characters and at most 1000 characters")); @@ -273,7 +273,7 @@ void givenWrongStatus_whenUpdateAlert_thenBadRequest() throws JsonProcessingExce ) .header(oAuth2Support.jwtAuthorization(JwtRole.SUPERVISOR)) .when() - .post("/api/alerts/1/update") + .post("/api/notifications/1/update") .then() .statusCode(400) .body(Matchers.containsString("message\":\"NoSuchElementException: Unsupported UpdateInvestigationStatus: wrongStatus. Must be one of: ACKNOWLEDGED, ACCEPTED, DECLINED")); @@ -298,7 +298,7 @@ void shouldCancelAlert() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startAlertRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -308,7 +308,7 @@ void shouldCancelAlert() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -320,7 +320,7 @@ void shouldCancelAlert() throws JsonProcessingException, JoseException { .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .contentType(ContentType.JSON) .when() - .post("/api/alerts/$alertId/cancel".replace("$alertId", alertId.toString())) + .post("/api/notifications/$alertId/cancel".replace("$alertId", alertId.toString())) .then() .statusCode(204); @@ -330,7 +330,7 @@ void shouldCancelAlert() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -365,7 +365,7 @@ void shouldApproveAlertStatus() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startAlertRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -376,7 +376,7 @@ void shouldApproveAlertStatus() throws JsonProcessingException, JoseException { .contentType(ContentType.JSON) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$alertId/approve".replace("$alertId", alertId.toString())) + .post("/api/notifications/$alertId/approve".replace("$alertId", alertId.toString())) .then() .statusCode(204); @@ -387,7 +387,7 @@ void shouldApproveAlertStatus() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -422,7 +422,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startAlertRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -435,7 +435,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .contentType(ContentType.JSON) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$alertId/approve".replace("$alertId", alertId.toString())) + .post("/api/notifications/$alertId/approve".replace("$alertId", alertId.toString())) .then() .statusCode(204); @@ -445,7 +445,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -464,7 +464,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(closeAlertRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$alertId/close".replace("$alertId", alertId.toString())) + .post("/api/notifications/$alertId/close".replace("$alertId", alertId.toString())) .then() .statusCode(204); @@ -474,7 +474,7 @@ void shouldCloseAlertStatus() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -491,7 +491,7 @@ void givenNonExistingAlert_whenCancel_thenReturnNotFound() throws JoseException .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .contentType(ContentType.JSON) .when() - .post("/api/alerts/1/cancel") + .post("/api/notifications/1/cancel") .then() .statusCode(404) .body("message", Matchers.is("Notification with id: 1 not found")); @@ -504,7 +504,7 @@ void givenNoAuthorization_whenCancel_thenReturn401() { .param("size", "10") .contentType(ContentType.JSON) .when() - .post("/api/alerts/1/cancel") + .post("/api/notifications/1/cancel") .then() .statusCode(401); } @@ -535,7 +535,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startAlertRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts") + .post("/api/notifications") .then() .statusCode(201) .body("id", Matchers.isA(Number.class)); @@ -553,7 +553,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java index 1df2b0c390..e832963bfc 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java @@ -65,7 +65,7 @@ void shouldNotReturnAlertWithoutAuthentication() { given() .contentType(ContentType.JSON) .when() - .get("/api/alerts/123") + .get("/api/notifications/123") .then() .statusCode(401); } @@ -75,7 +75,7 @@ void shouldNotReturnAlertsWithoutAuthentication() { given() .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(401); } @@ -88,7 +88,7 @@ void shouldReturnNoAlerts() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -109,7 +109,7 @@ void givenAlerts_whenGetSenderAlertsSortedAsc_thenReturnProperlySorted() throws .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -132,7 +132,7 @@ void givenAlerts_whenGetSenderAlertsSortedDesc_thenReturnProperlySorted() throws .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -156,7 +156,7 @@ void givenSortByDescriptionProvided_whenGetInvestigations_thenReturnInvestigatio .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -179,7 +179,7 @@ void givenSortByStatusProvided_whenGetInvestigations_thenReturnInvestigationsPro .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -200,7 +200,7 @@ void givenInvalidSort_whenGet_thenBadRequest() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(400) .body("message", Matchers.is( @@ -257,7 +257,7 @@ void shouldReturnProperlyPagedReceivedAlerts() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(2, 10, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("content.createdBy", Matchers.hasItems(senderBPN)) @@ -276,7 +276,7 @@ void givenNoAlertId_whenGetAlertById_thenReturnNotFound() throws JoseException { .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .when() - .get("/api/alerts/1234") + .get("/api/notifications/1234") .then() .statusCode(404) .body("message", Matchers.is("Notification with id: 1234 not found")); @@ -293,7 +293,7 @@ void shouldReturnInvestigationById() throws JoseException { .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .when() - .get("/api/alerts/{alertId}", storedAlert.getId()) + .get("/api/notifications/{alertId}", storedAlert.getId()) .then() .statusCode(200) .body("id", Matchers.is(storedAlert.getId().intValue())) @@ -319,7 +319,7 @@ void givenNonExistingSortField_whenGetAlerts_thenBadRequest() throws JoseExcepti .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java index e9f7a407d1..c902d7e6d3 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReceiverAlertsControllerIT.java @@ -67,7 +67,7 @@ void shouldNotUpdateToAcknowledgedNonExistingAlert() throws JoseException { """.replace("$status", UpdateQualityNotificationStatusRequest.ACKNOWLEDGED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) + .post("/api/notifications/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) .then() .statusCode(404); @@ -77,7 +77,7 @@ void shouldNotUpdateToAcknowledgedNonExistingAlert() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 15, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -102,7 +102,7 @@ void shouldNotUpdateToAcceptedNonExistingAlert() throws JoseException { """.replace("$status", UpdateQualityNotificationStatusRequest.ACCEPTED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) + .post("/api/notifications/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) .then() .statusCode(404); @@ -112,7 +112,7 @@ void shouldNotUpdateToAcceptedNonExistingAlert() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 15, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -137,7 +137,7 @@ void shouldNotUpdateToDeclinedNonExistingAlert() throws JoseException { """.replace("$status", UpdateQualityNotificationStatusRequest.DECLINED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) + .post("/api/notifications/$notExistingAlertId/update".replace("$notExistingAlertId", Long.toString(notExistingAlertId))) .then() .statusCode(404); @@ -147,7 +147,7 @@ void shouldNotUpdateToDeclinedNonExistingAlert() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 15, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -168,7 +168,7 @@ void shouldNotUpdateWithInvalidRequest(final String request) throws JoseExceptio .body(request) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/alerts/{notExistingAlertId}/update", Long.toString(notExistingAlertId)) + .post("/api/notifications/{notExistingAlertId}/update", Long.toString(notExistingAlertId)) .then() .statusCode(400); @@ -178,7 +178,7 @@ void shouldNotUpdateWithInvalidRequest(final String request) throws JoseExceptio .body(new PageableFilterRequest(new OwnPageable(0, 15, List.of()), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/alerts/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java index d18a9c06a1..a6bf04f89f 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java @@ -75,7 +75,7 @@ void givenInvestigations_whenProvideNoFilter_thenReturnAll() throws JoseExceptio .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -96,7 +96,7 @@ void givenInvestigations_whenProvideBpnFilter_thenReturnExpectedResult() throws .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -118,7 +118,7 @@ void givenInvestigations_whenProvideBpnFilterAnd_thenReturnExpectedResult() thro .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -146,7 +146,7 @@ void givenAlerts_whenProvideTooManyFilters_thenReturnError() throws JoseExceptio .when() .log() .uri() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .log().all() .statusCode(200) @@ -166,7 +166,7 @@ void givenInvestigations_whenInvalidLocalDate_thenReturnBadRequest() throws Jose .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } @@ -183,7 +183,7 @@ void givenInvestigations_whenTargetDateAtLocalDate_thenExpectedResult() throws J .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -204,7 +204,7 @@ void givenInvestigations_whenSendToFilter_thenExpectedResult() throws JoseExcept .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -226,7 +226,7 @@ void givenInvestigations_whenSendToFilterAndSort_thenExpectedResult() throws Jos .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -247,7 +247,7 @@ void givenInvestigations_whenProvideFilterWithSeverityCritical_thenReturnAllCrit .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -268,7 +268,7 @@ void givenInvestigations_whenProvideFilterCreatedBy_thenReturnAllCritical() thro .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -289,7 +289,7 @@ void givenInvestigations_whenProvideFilterCreatedByName_thenReturnAllCritical() .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -311,7 +311,7 @@ void givenAlerts_whenProvideDateRangeFilters_thenReturnExpectedResult() throws J .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -333,7 +333,7 @@ void givenAlerts_whenProvideDateRangeFiltersXAnd_thenReturnExpectedResult() thro .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter1, filter2)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -354,7 +354,7 @@ void givenNonExistingFilterField_whenGetInvestigations_thenBadRequest() throws J .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } @@ -384,7 +384,7 @@ void givenInvestigations_whenGetInvestigationsByAssetId_thenReturnOnlyRelatedInv .body(new PageableFilterRequest(null, new SearchCriteriaRequestParam(List.of(filter)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .assertThat() diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java index 4aab4e3cfe..cf2a46afc0 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java @@ -60,7 +60,7 @@ void givenDescriptionField_whenCallDistinctFilterValues_thenProperResponse() thr .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -86,7 +86,7 @@ void givenDescriptionFieldStartWith_whenCallDistinctFilterValues_thenProperRespo .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -113,7 +113,7 @@ void givenDescriptionFieldStartWithAndReceiver_whenCallDistinctFilterValues_then .param("size", size) .param("startWith", startWith) .param("channel", channel) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -140,7 +140,7 @@ void givenDescriptionFieldStartWithAndSender_whenCallDistinctFilterValues_thenPr .param("size", size) .param("startWith", startWith) .param("channel", channel) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -163,7 +163,7 @@ void givenBpnField_whenCallDistinctFilterValues_thenProperResponse() throws Jose .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -188,7 +188,7 @@ void givenBpnFieldStartWithCaseInsensitive1_whenCallDistinctFilterValues_thenPro .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -213,7 +213,7 @@ void givenBpnFieldStartWithCaseInsensitive2_whenCallDistinctFilterValues_thenPro .param("fieldName", fieldName) .param("size", size) .param("startWith", startWith) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -236,7 +236,7 @@ void givenCreatedDateField_whenCallDistinctFilterValues_thenProperResponse() thr .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -265,7 +265,7 @@ void givenCreatedDateFieldAndNoSize_whenCallDistinctFilterValues_thenProperRespo .log().all() .when() .param("fieldName", fieldName) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -296,7 +296,7 @@ void givenCreatedByField_whenCallDistinctFilterValues_thenProperResponse() throw .when() .param("fieldName", fieldName) .param("size", size) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -321,7 +321,7 @@ void givenCreatedByFieldAndSender_whenCallDistinctFilterValues_thenProperRespons .param("fieldName", fieldName) .param("size", size) .param("channel", channel) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -346,7 +346,7 @@ void givenCreatedByFieldAndReceiver_whenCallDistinctFilterValues_thenProperRespo .param("fieldName", fieldName) .param("size", size) .param("channel", channel) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) @@ -368,7 +368,7 @@ void givenEnumTypeFields_whenCallDistinctFilterValues_thenProperResponse( .when() .param("fieldName", fieldName) .param("size", resultLimit.toString()) - .get("/api/investigations/distinctFilterValues") + .get("/api/notifications/distinctFilterValues") .then() .log().all() .statusCode(200) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java index 3260face9e..fdd9d17693 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java @@ -145,7 +145,7 @@ void shouldStartInvestigation() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201) .body("id", Matchers.isA(Number.class)); @@ -163,7 +163,7 @@ void shouldStartInvestigation() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -191,7 +191,7 @@ void givenMissingSeverity_whenStartInvestigation_thenBadRequest() throws JsonPro .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(400); } @@ -219,7 +219,7 @@ void givenDescriptionExceedsMaxLength_whenStartInvestigation_thenBadRequest() th .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(400) .body(Matchers.containsString("Description should have at least 15 characters and at most 1000 characters")); @@ -242,7 +242,7 @@ void givenInvestigationReasonTooLong_whenUpdate_thenBadRequest() throws JsonProc .body(objectMapper.writeValueAsString(request)) .header(oAuth2Support.jwtAuthorization(JwtRole.SUPERVISOR)) .when() - .post("/api/investigations/1/update") + .post("/api/notifications/1/update") .then() .statusCode(400) .body(Matchers.containsString("Reason should have at least 15 characters and at most 1000 characters")); @@ -267,7 +267,7 @@ void givenWrongStatus_whenUpdateInvestigation_thenBadRequest() throws JsonProces .replace("ACCEPTED", "wrongStatus")) .header(oAuth2Support.jwtAuthorization(JwtRole.SUPERVISOR)) .when() - .post("/api/investigations/1/update") + .post("/api/notifications/1/update") .then() .statusCode(400) .body(Matchers.containsString("message\":\"NoSuchElementException: Unsupported UpdateInvestigationStatus: wrongStatus. Must be one of: ACKNOWLEDGED, ACCEPTED, DECLINED")); @@ -290,7 +290,7 @@ void shouldCancelInvestigation() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startInvestigationRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -300,7 +300,7 @@ void shouldCancelInvestigation() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -311,7 +311,7 @@ void shouldCancelInvestigation() throws JsonProcessingException, JoseException { .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .contentType(ContentType.JSON) .when() - .post("/api/investigations/$investigationId/cancel".replace("$investigationId", investigationId.toString())) + .post("/api/notifications/$investigationId/cancel".replace("$investigationId", investigationId.toString())) .then() .statusCode(204); @@ -320,7 +320,7 @@ void shouldCancelInvestigation() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -352,7 +352,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .body(objectMapper.writeValueAsString(startInvestigationRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -363,7 +363,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .contentType(ContentType.JSON) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{investigationId}/approve", investigationId) + .post("/api/notifications/{investigationId}/approve", investigationId) .then() .statusCode(204); @@ -373,7 +373,7 @@ void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseExce .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .log().all() .statusCode(200) @@ -410,7 +410,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body(objectMapper.writeValueAsString(startInvestigationRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201) .extract().path("id"); @@ -423,7 +423,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .contentType(ContentType.JSON) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{investigationId}/approve", investigationId) + .post("/api/notifications/{investigationId}/approve", investigationId) .then() .statusCode(204); // then @@ -432,7 +432,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -451,7 +451,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body(objectMapper.writeValueAsString(closeInvestigationRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{investigationId}/close", investigationId) + .post("/api/notifications/{investigationId}/close", investigationId) .then() .statusCode(204); @@ -461,7 +461,7 @@ void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseExcept .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -479,7 +479,7 @@ void givenNonExistingInvestigation_whenCancel_thenReturnNotFound() throws JoseEx .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .contentType(ContentType.JSON) .when() - .post("/api/investigations/1/cancel") + .post("/api/notifications/1/cancel") .then() .statusCode(404) .body("message", Matchers.is("Notification with id: 1 not found")); @@ -492,7 +492,7 @@ void givenNoAuthorization_whenCancel_thenReturn401() { .param("size", "10") .contentType(ContentType.JSON) .when() - .post("/api/investigations/1/cancel") + .post("/api/notifications/1/cancel") .then() .statusCode(401); } @@ -521,7 +521,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .body(objectMapper.writeValueAsString(startInvestigationRequest)) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations") + .post("/api/notifications") .then() .statusCode(201) .body("id", Matchers.isA(Number.class)); @@ -538,7 +538,7 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of("channel,EQUAL,SENDER,AND")))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java index 0fc9afb06d..abe6e2c7f2 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java @@ -64,7 +64,7 @@ void shouldNotReturnInvestigationWithoutAuthentication() { .param("size", "10") .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(401); } @@ -74,7 +74,7 @@ void shouldNotReturnInvestigationWithIdWithoutAuthentication() { given() .contentType(ContentType.JSON) .when() - .get("/api/investigations/123") + .get("/api/notifications/123") .then() .statusCode(401); } @@ -87,7 +87,7 @@ void shouldReturnNoInvestigations() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of()), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -108,7 +108,7 @@ void givenInvestigations_whenGetSenderInvestigationsSortedAsc_thenReturnProperly .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -131,7 +131,7 @@ void givenInvestigations_whenGetSenderInvestigationsSortedDesc_thenReturnProperl .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -155,7 +155,7 @@ void givenSortByDescriptionProvided_whenGetInvestigations_thenReturnInvestigatio .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -179,7 +179,7 @@ void givenSortByStatusProvided_whenGetInvestigations_thenReturnInvestigationsPro .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of(filterString)))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(0)) @@ -200,7 +200,7 @@ void givenInvalidSort_whenGet_thenBadRequest() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(400) .body("message", Matchers.is( @@ -236,7 +236,7 @@ void shouldReturnPagedInvestigations() throws JoseException { .body(new PageableFilterRequest(new OwnPageable(2, 10, List.of()), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(200) .body("page", Matchers.is(2)) @@ -251,7 +251,7 @@ void givenNonExistingInvestigation_whenGetInvestigationById_thenReturnNotFound() .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .when() - .get("/api/investigations/1234") + .get("/api/notifications/1234") .then() .statusCode(404) .body("message", Matchers.is("Notification with id: 1234 not found")); @@ -268,7 +268,7 @@ void shouldReturnInvestigationById() throws JoseException { .header(oAuth2Support.jwtAuthorization(ADMIN)) .contentType(ContentType.JSON) .when() - .get("/api/investigations/{investigationId}", storedInvestigation.getId()) + .get("/api/notifications/{investigationId}", storedInvestigation.getId()) .then() .statusCode(200) .body("id", Matchers.is(storedInvestigation.getId().intValue())) @@ -289,7 +289,7 @@ void givenNonExistingSortField_whenGetInvestigations_thenBadRequest() throws Jos .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of("nonExistingField,ASC")), new SearchCriteriaRequestParam(List.of()))) .contentType(ContentType.JSON) .when() - .post("/api/investigations/filter") + .post("/api/notifications/filter") .then() .statusCode(400); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java index af94073c1e..8e2847c071 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReceiverInvestigationsControllerIT.java @@ -56,7 +56,7 @@ void shouldNotUpdateToAcknowledgedNonExistingInvestigation() throws JoseExceptio """.replace("$status", UpdateQualityNotificationStatusRequest.ACKNOWLEDGED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{notExistingInvestigationId}/update", notExistingInvestigationId) + .post("/api/notifications/{notExistingInvestigationId}/update", notExistingInvestigationId) .then() .statusCode(404); } @@ -77,7 +77,7 @@ void shouldNotUpdateToAcceptedNonExistingInvestigation() throws JoseException { """.replace("$status", UpdateQualityNotificationStatusRequest.ACCEPTED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{notExistingInvestigationId}/update", notExistingInvestigationId) + .post("/api/notifications/{notExistingInvestigationId}/update", notExistingInvestigationId) .then() .statusCode(404); } @@ -98,7 +98,7 @@ void shouldNotUpdateToDeclinedNonExistingInvestigation() throws JoseException { """.replace("$status", UpdateQualityNotificationStatusRequest.DECLINED.name())) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{notExistingInvestigationId}/update", notExistingInvestigationId) + .post("/api/notifications/{notExistingInvestigationId}/update", notExistingInvestigationId) .then() .statusCode(404); } @@ -115,7 +115,7 @@ void shouldNotUpdateWithInvalidRequest(final String request) throws JoseExceptio .body(request) .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) .when() - .post("/api/investigations/{notExistingInvestigationId}/update", Long.toString(notExistingInvestigationId)) + .post("/api/notifications/{notExistingInvestigationId}/update", Long.toString(notExistingInvestigationId)) .then() .statusCode(400); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/response/AlertResponseTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/response/AlertResponseTest.java index c4eb08fabb..a08b83809f 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/response/AlertResponseTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/response/AlertResponseTest.java @@ -20,14 +20,14 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.alert.response; import org.eclipse.tractusx.traceability.common.model.PageResult; -import org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper.AlertResponseMapper; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.NotificationResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; import org.junit.jupiter.api.Test; -import qualitynotification.alert.response.AlertResponse; import qualitynotification.base.response.QualityNotificationReasonResponse; +import qualitynotification.base.response.QualityNotificationResponse; import qualitynotification.base.response.QualityNotificationSeverityResponse; import qualitynotification.base.response.QualityNotificationSideResponse; import qualitynotification.base.response.QualityNotificationStatusResponse; @@ -44,7 +44,7 @@ void givenQualityNotification_whenFrom_thenConstructProperAlertResponse() { final QualityNotification notification = InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationStatus.ACCEPTED, QualityNotificationStatus.CREATED); // when - final AlertResponse result = AlertResponseMapper.from(notification); + final QualityNotificationResponse result = NotificationResponseMapper.from(notification); // then assertThat(result) @@ -84,7 +84,7 @@ void givenQualityNotificationPaged_whenFromAsPageResult_thenConstructProperAlert final PageResult pagedNotification = new PageResult<>(List.of(notification), page1, pageCount1, pageSize1, totalItems1); // when - final PageResult result = AlertResponseMapper.fromAsPageResult(pagedNotification); + final PageResult result = NotificationResponseMapper.fromAsPageResult(pagedNotification); // then assertThat(result) @@ -95,7 +95,7 @@ void givenQualityNotificationPaged_whenFromAsPageResult_thenConstructProperAlert assertThat(result.content()).hasSize(1) .first() .usingRecursiveComparison() - .isEqualTo(AlertResponseMapper.from(notification)); + .isEqualTo(NotificationResponseMapper.from(notification)); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java index 393c17fefd..1a27085973 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java @@ -19,7 +19,8 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.alert.rest; -import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.rest.NotificationController; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; @@ -31,7 +32,6 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -import qualitynotification.alert.response.AlertResponse; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationSeverityRequest; import qualitynotification.base.request.QualityNotificationTypeRequest; @@ -40,6 +40,7 @@ import qualitynotification.base.request.UpdateQualityNotificationStatusRequest; import qualitynotification.base.response.QualityNotificationIdResponse; import qualitynotification.base.response.QualityNotificationReasonResponse; +import qualitynotification.base.response.QualityNotificationResponse; import qualitynotification.base.response.QualityNotificationSeverityResponse; import qualitynotification.base.response.QualityNotificationSideResponse; import qualitynotification.base.response.QualityNotificationStatusResponse; @@ -61,7 +62,7 @@ class AlertControllerTest { @InjectMocks - private AlertController controller; + private NotificationController controller; @Test void givenRequestBody_whenAlertAssets_thenResponse() { @@ -97,7 +98,7 @@ void givenRequest_whenGetAlert_thenProperResponse() { when(alertService.find(request)).thenReturn(notification); // when - final AlertResponse result = controller.getAlert(request); + final QualityNotificationResponse result = controller.getAlert(request); // then assertThat(result) diff --git a/tx-models/src/main/java/qualitynotification/alert/response/AlertResponse.java b/tx-models/src/main/java/qualitynotification/alert/response/AlertResponse.java deleted file mode 100644 index 89035568ac..0000000000 --- a/tx-models/src/main/java/qualitynotification/alert/response/AlertResponse.java +++ /dev/null @@ -1,33 +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 qualitynotification.alert.response; - -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.ToString; -import lombok.experimental.SuperBuilder; -import qualitynotification.base.response.QualityNotificationResponse; - - -@ToString(callSuper = true) -@SuperBuilder -@ArraySchema(arraySchema = @Schema(description = "Alerts", additionalProperties = Schema.AdditionalPropertiesValue.FALSE), maxItems = Integer.MAX_VALUE) -public class AlertResponse extends QualityNotificationResponse { -} diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java index 84efc2e374..a1eae13f83 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java @@ -18,6 +18,7 @@ ********************************************************************************/ package qualitynotification.base.response; +import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Size; import lombok.AllArgsConstructor; @@ -33,6 +34,7 @@ @SuperBuilder @AllArgsConstructor @RequiredArgsConstructor +@ArraySchema(arraySchema = @Schema(description = "Notifications", additionalProperties = Schema.AdditionalPropertiesValue.FALSE), maxItems = Integer.MAX_VALUE) public class QualityNotificationResponse { @Schema(example = "66", maxLength = 255) From 14fabd080ce6275682742eaa9dc460d1d65a54e7 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 08:08:16 +0100 Subject: [PATCH 05/13] chore(tx-backend) 706 add title and remove Alert and investigation related classes --- CHANGELOG.md | 6 + .../openapi/traceability-foss-backend.json | 1264 +++++++++-------- .../service/DashboardServiceImpl.java | 2 +- .../asbuilt/model/AssetAsBuiltEntity.java | 5 +- .../asbuilt/model/AssetAsBuiltViewEntity.java | 4 +- .../common/config/ErrorHandlingConfig.java | 29 +- .../rest/NotificationController.java | 6 +- .../service/QualityNotificationService.java | 4 +- ...ualityNotificationValidationException.java | 2 +- .../UpdateQualityNotificationValidator.java | 2 +- .../exception/AlertNotFoundException.java | 27 - .../domain/base/AlertRepository.java | 25 - .../domain/base/InvestigationRepository.java | 28 - .../base/model/QualityNotification.java | 20 +- .../model/QualityNotificationMessage.java | 2 +- ...actQualityNotificationReceiverService.java | 2 +- .../AbstractQualityNotificationService.java | 7 +- .../service/EdcNotificationServiceImpl.java | 20 +- .../base/service/InvestigationsEDCFacade.java | 23 +- .../service/NotificationPublisherService.java | 36 +- .../InvestigationsReceiverService.java | 69 - .../exception/InvestigationIllegalUpdate.java | 2 +- .../InvestigationNotFoundException.java | 2 +- ...stigationReceiverBpnMismatchException.java | 2 +- ...vestigationStatusTransitionNotAllowed.java | 2 +- .../exception/NotificationIllegalUpdate.java} | 6 +- .../NotificationNotFoundException.java | 2 +- .../NotificationNotSupportedException.java | 2 +- ...otificationStatusTransitionNotAllowed.java | 2 +- .../model/StartQualityNotification.java | 5 +- .../repository}/NotificationRepository.java | 4 +- .../QualityNotificationRepository.java | 2 +- .../service/NotificationReceiverService.java} | 16 +- .../service/NotificationServiceImpl.java | 8 +- .../alert/model/AlertEntity.java | 104 -- .../alert/model/AlertNotificationEntity.java | 113 -- .../alert/repository/AlertSpecification.java | 42 - .../repository/AlertsRepositoryImpl.java | 245 ---- .../JpaAlertNotificationRepository.java | 29 - .../alert/repository/JpaAlertRepository.java | 52 - .../edc/EDCNotificationValidator.java | 2 +- .../infrastructure/edc/EdcController.java | 16 +- .../model/InvestigationEntity.java | 107 -- .../InvestigationNotificationEntity.java | 114 -- .../InvestigationSpecification.java | 42 - .../InvestigationsRepositoryImpl.java | 222 --- ...paInvestigationNotificationRepository.java | 28 - .../JpaInvestigationRepository.java | 48 - .../model/NotificationBaseEntity.java | 3 +- .../model/NotificationEntity.java | 6 +- .../model/NotificationMessageBaseEntity.java} | 4 +- .../model/NotificationMessageEntity.java | 7 +- .../model/NotificationSideBaseEntity.java | 2 +- .../model/NotificationStatusBaseEntity.java | 2 +- .../model/NotificationTypeEntity.java | 2 +- .../repository/JpaNotificationRepository.java | 6 +- .../NotificationRepositoryImpl.java | 8 +- ...0__merge_alert_and_notification_tables.sql | 9 +- .../config/ErrorHandlingConfigTest.java | 12 +- .../EDCNotificationValidatorTest.java | 2 +- .../edc/model/EdcNotificationModelTest.java | 13 +- .../assets/AssetAsBuiltControllerByIdIT.java | 16 +- .../AssetAsBuiltControllerFilteringIT.java | 20 +- .../assets/DashboardControllerIT.java | 6 +- .../support/AlertNotificationsSupport.java | 10 +- .../common/support/AlertsSupport.java | 7 +- .../common/support/AssetsSupport.java | 3 - .../InvestigationNotificationsSupport.java | 8 +- .../InvestigationsRepositoryProvider.java | 8 +- .../common/support/InvestigationsSupport.java | 25 +- .../support/NotificationMessageSupport.java | 2 +- .../common/support/NotificationSupport.java | 9 +- .../edc/blackbox/EdcControllerIT.java | 11 +- .../alert/AlertControllerFilterIT.java | 16 +- .../alert/PublisherAlertsControllerIT.java | 6 +- .../alert/ReadAlertsControllerIT.java | 10 +- .../InvestigationControllerFilterIT.java | 16 +- .../PublisherInvestigationsControllerIT.java | 8 +- .../ReadInvestigationsControllerIT.java | 8 +- .../alert/rest/AlertControllerTest.java | 4 +- .../service/InvestigationServiceImplTest.java | 7 +- .../investigation/InvestigationTest.java | 4 +- .../EdcNotificationServiceImplTest.java | 9 +- .../InvestigationsReceiverServiceTest.java | 6 +- .../NotificationPublisherServiceTest.java | 41 +- .../InvestigationsRepositoryImplTest.java | 23 +- ...va => NotificationRepositoryImplTest.java} | 30 +- ...pdateQualityNotificationValidatorTest.java | 4 +- .../StartQualityNotificationRequest.java | 5 + .../response/QualityNotificationResponse.java | 4 + 90 files changed, 936 insertions(+), 2268 deletions(-) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{ => notification}/service/QualityNotificationService.java (96%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{ => notification}/validation/UpdateQualityNotificationValidationException.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/{ => notification}/validation/UpdateQualityNotificationValidator.java (98%) delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertNotFoundException.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/InvestigationRepository.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/InvestigationIllegalUpdate.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/InvestigationNotFoundException.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/InvestigationReceiverBpnMismatchException.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/InvestigationStatusTransitionNotAllowed.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{alert/model/exception/AlertIllegalUpdate.java => notification/exception/NotificationIllegalUpdate.java} (86%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{ => notification/exception}/NotificationNotFoundException.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/NotificationNotSupportedException.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{investigation/model => notification}/exception/NotificationStatusTransitionNotAllowed.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{alert => notification}/model/StartQualityNotification.java (95%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{base => notification/repository}/NotificationRepository.java (92%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{ => notification}/repository/QualityNotificationRepository.java (99%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{alert/service/AlertsReceiverService.java => notification/service/NotificationReceiverService.java} (84%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/{ => notification}/service/NotificationServiceImpl.java (92%) delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertSpecification.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertNotificationRepository.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationEntity.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationSpecification.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java delete mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/{ => notification}/model/NotificationBaseEntity.java (97%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/{model/QualityNotificationMessageBaseEntity.java => notification/model/NotificationMessageBaseEntity.java} (96%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/{ => notification}/model/NotificationSideBaseEntity.java (96%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/{ => notification}/model/NotificationStatusBaseEntity.java (99%) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/{ => notification}/model/NotificationTypeEntity.java (97%) rename tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/{AlertsRepositoryImplTest.java => NotificationRepositoryImplTest.java} (76%) diff --git a/CHANGELOG.md b/CHANGELOG.md index bab45c9b7d..468c8ba9dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #695 OAuth2.0 Client scope configuration - #606 Added error message into notifications on failure - #596 Added Policy management documentation +- #706 Created notification classes to support both alert and investigations +- #706 Notification controller having the same endpoints as alerts and investigations controllers ### Changed - #709 Bumped spring-core from 6.0.17 to 6.1.5 @@ -19,9 +21,13 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #606 refactored response model to only be used by common model package tx-models - #709 Fixed CVE-2024-22257 overriding spring-security-core from 6.1.7 to 6.2.3 - #596 Policy management has been moved to different module +- #706 StartNotificationRequest now requires additional parameter type ("ALERT", "INVESTIGATION") which +- #706 Search criteria allows to filter by new type parameter +- #706 Notification response have new title parameter ### Removed - Shedlock, resilence4j, templateResolver as not used anymore +- #706 Removed alert and investigation specific classes and services to replace them with merged notification classes ### Added - #630 Added Parts extended detailed view diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index f8988552fd..912864c786 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -31,18 +31,23 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -51,23 +56,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -76,8 +76,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -86,8 +86,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -106,8 +106,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -148,18 +148,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -193,8 +183,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -203,8 +193,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -223,8 +223,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -265,18 +265,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -310,8 +300,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -320,8 +310,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -340,8 +340,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -379,8 +379,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -389,8 +389,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -399,8 +399,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -409,18 +409,18 @@ } } }, - "200" : { - "description" : "Returns submodel payload", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "type" : "string" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -429,12 +429,12 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns submodel payload", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "type" : "string" } } } @@ -449,8 +449,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -496,8 +496,11 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Ok." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -506,8 +509,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -516,11 +519,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -529,8 +529,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -539,11 +542,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -562,8 +562,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -783,8 +783,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -793,8 +793,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -803,8 +803,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -813,28 +813,28 @@ } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/CreateNotificationContractResponse" } } } }, - "201" : { - "description" : "Created.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -853,8 +853,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -892,69 +892,69 @@ "required" : true }, "responses" : { - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Ok.", "content" : { "application/json" : { "schema" : { - "type" : "string", - "example" : { - "message" : "Forbidden." + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" } } } } }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Too many requests." + "message" : "Not found." } } } } }, - "200" : { - "description" : "Ok.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "PageResults", - "items" : { - "$ref" : "#/components/schemas/PageResultContractResponse" + "type" : "string", + "example" : { + "message" : "Too many requests." } } } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Authorization failed." + "message" : "Unsupported media type." } } } } }, - "415" : { - "description" : "Unsupported media type.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Unsupported media type." + "message" : "Bad request." } } } @@ -973,27 +973,27 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Bad request." + "message" : "Authorization failed." } } } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Not found." + "message" : "Forbidden." } } } @@ -1040,8 +1040,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1050,8 +1050,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1060,8 +1060,14 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1070,11 +1076,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1083,14 +1086,8 @@ } } }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1099,6 +1096,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -1109,8 +1109,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1156,8 +1156,8 @@ } }, "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1166,8 +1166,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1176,8 +1176,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1186,31 +1186,28 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportResponse" } } } }, - "200" : { - "description" : "OK.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1219,6 +1216,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -1229,8 +1229,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1268,8 +1268,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1278,8 +1278,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1288,8 +1288,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1298,8 +1298,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1308,11 +1311,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1331,8 +1331,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1370,6 +1370,26 @@ "required" : true }, "responses" : { + "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" : { @@ -1380,6 +1400,26 @@ } } }, + "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" : "Returns the paged result found for Asset", "content" : { @@ -1572,46 +1612,6 @@ } } }, - "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "400" : { "description" : "Bad request.", "content" : { @@ -1622,8 +1622,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1661,8 +1661,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1671,8 +1671,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1681,8 +1681,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1691,8 +1691,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "201" : { + "description" : "Created." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1701,11 +1704,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1724,8 +1724,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1763,18 +1763,8 @@ "required" : true }, "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1793,16 +1783,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -1995,8 +1975,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2005,8 +1985,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2024,6 +2004,26 @@ } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -2054,6 +2054,26 @@ } ], "responses" : { + "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" : { @@ -2074,6 +2094,26 @@ } } }, + "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" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -2261,26 +2301,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" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -2290,26 +2310,6 @@ } } } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -2348,36 +2348,6 @@ "required" : true }, "responses" : { - "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" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -2575,8 +2545,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2585,8 +2555,18 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2604,6 +2584,26 @@ } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -2634,8 +2634,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2644,8 +2644,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2841,8 +2841,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2851,8 +2851,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2861,8 +2861,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2881,8 +2881,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2928,26 +2928,6 @@ "required" : true }, "responses" : { - "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 updated asset", "content" : { @@ -3135,6 +3115,16 @@ } } }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "404" : { "description" : "Not found.", "content" : { @@ -3145,8 +3135,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3155,8 +3145,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3175,8 +3175,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3204,8 +3204,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3214,8 +3214,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3224,8 +3224,11 @@ } } }, - "404" : { - "description" : "Not found.", + "202" : { + "description" : "Created registry reload job." + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3234,8 +3237,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3244,11 +3247,8 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3267,8 +3267,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3296,8 +3296,8 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3306,8 +3306,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3316,18 +3316,18 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Returns the policies", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3336,18 +3336,18 @@ } } }, - "200" : { - "description" : "Returns the policies", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3366,8 +3366,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3493,18 +3493,18 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3523,8 +3523,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3533,18 +3533,18 @@ } } }, - "200" : { - "description" : "Returns dashboard data", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3563,8 +3563,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3603,28 +3603,28 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "200" : { - "description" : "OK.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3633,8 +3633,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3643,11 +3643,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3656,8 +3653,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3666,6 +3663,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "400" : { "description" : "Bad request.", "content" : { @@ -3676,8 +3676,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3723,18 +3723,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3753,16 +3743,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3955,8 +3935,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3965,8 +3945,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3984,6 +3964,26 @@ } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -4046,18 +4046,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4076,8 +4081,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4086,23 +4091,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4121,8 +4121,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4156,22 +4156,12 @@ "required" : true, "schema" : { "type" : "string" - } - } - ], - "responses" : { - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", + } + } + ], + "responses" : { + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4190,16 +4180,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -4387,8 +4367,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4397,8 +4377,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4416,6 +4396,26 @@ } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -4454,8 +4454,8 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4464,8 +4464,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4666,8 +4666,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4676,8 +4676,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4686,8 +4686,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4706,8 +4706,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4777,18 +4777,23 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4807,8 +4812,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4817,23 +4822,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4852,8 +4852,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4881,8 +4881,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4891,8 +4891,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4901,8 +4901,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4911,8 +4911,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4921,23 +4921,18 @@ } } }, - "200" : { - "description" : "Returns the assets found", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4946,18 +4941,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the assets found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5182,8 +5182,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5192,8 +5192,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5202,8 +5202,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5212,8 +5212,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5222,8 +5222,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5242,8 +5242,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5271,8 +5271,11 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Ok." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5281,8 +5284,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5291,11 +5294,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5304,8 +5304,11 @@ } } }, - "500" : { - "description" : "Internal server error.", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5314,11 +5317,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5337,8 +5337,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5376,8 +5376,11 @@ } ], "responses" : { - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Okay" + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5386,8 +5389,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "204" : { + "description" : "Deleted." + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5396,8 +5402,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5406,8 +5412,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5416,11 +5422,8 @@ } } }, - "200" : { - "description" : "Okay" - }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5439,11 +5442,8 @@ } } }, - "204" : { - "description" : "Deleted." - }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5516,6 +5516,12 @@ ], "type" : "object", "properties" : { + "title" : { + "maxLength" : 255, + "minLength" : 1, + "type" : "string", + "example" : "title" + }, "partIds" : { "maxLength" : 100, "minLength" : 1, @@ -5803,6 +5809,12 @@ "format" : "int64", "example" : 66 }, + "title" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Title" + }, "status" : { "maxLength" : 255, "minLength" : 0, diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java index b2b87332c3..df1abdd316 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/dashboard/service/DashboardServiceImpl.java @@ -27,7 +27,7 @@ import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.domain.dashboard.model.Dashboard; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.springframework.stereotype.Component; 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 7a36bfcf9e..a6dc874181 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 @@ -42,9 +42,8 @@ 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.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.submodel.infrastructure.model.SubmodelPayloadEntity; 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 22bc4b66da..3f54d749be 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 @@ -39,8 +39,8 @@ 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.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.springframework.data.annotation.Immutable; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java index 423b0ae0c1..58abc3640a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfig.java @@ -43,17 +43,16 @@ import org.eclipse.tractusx.traceability.contracts.domain.exception.ContractException; import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; -import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation.UpdateQualityNotificationValidationException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationReceiverBpnMismatchException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationReceiverBpnMismatchException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationStatusTransitionNotAllowed; import org.eclipse.tractusx.traceability.submodel.domain.model.SubmodelNotFoundException; import org.springframework.context.support.DefaultMessageSourceResolvable; import org.springframework.http.HttpStatus; @@ -153,12 +152,6 @@ ResponseEntity handleInvestigationNotSupportedException(Notificat .body(new ErrorResponse(exception.getMessage())); } - @ExceptionHandler(AlertNotFoundException.class) - ResponseEntity handleAlertNotFoundException(AlertNotFoundException exception) { - log.warn("handleAlertNotFoundException", exception); - return ResponseEntity.status(HttpStatus.NOT_FOUND) - .body(new ErrorResponse(exception.getMessage())); - } @ExceptionHandler(NotificationNotFoundException.class) ResponseEntity handleNotificationNotFoundException(NotificationNotFoundException exception) { log.warn("handleNotificationNotFoundException", exception); @@ -208,8 +201,8 @@ ResponseEntity handleInvestigationIllegalUpdate(InvestigationIlle .body(new ErrorResponse(exception.getMessage())); } - @ExceptionHandler(AlertIllegalUpdate.class) - ResponseEntity handleAlertIllegalUpdate(AlertIllegalUpdate exception) { + @ExceptionHandler(NotificationIllegalUpdate.class) + ResponseEntity handleAlertIllegalUpdate(NotificationIllegalUpdate exception) { log.warn("handleAlertIllegalUpdate", exception); return ResponseEntity.status(HttpStatus.FORBIDDEN) .body(new ErrorResponse(exception.getMessage())); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java index 2e9a4bcc70..aeed5bc3b7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java @@ -29,7 +29,7 @@ import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.QualityNotificationFieldMapper; -import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.service.QualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.NotificationResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; @@ -54,8 +54,8 @@ import java.util.List; import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; -import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; +import static org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation.UpdateQualityNotificationValidator.validate; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification.from; @RestController @RequestMapping(value = "/notifications", consumes = "application/json", produces = "application/json") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/service/QualityNotificationService.java similarity index 96% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/service/QualityNotificationService.java index 86a268493e..7c20ef440b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/service/QualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/service/QualityNotificationService.java @@ -16,11 +16,11 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.service; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.service; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidationException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidationException.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidationException.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidationException.java index d6cae31969..b55fbde563 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidationException.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidationException.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.validation; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation; public class UpdateQualityNotificationValidationException extends RuntimeException { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidator.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidator.java similarity index 98% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidator.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidator.java index 68ec0733df..00fc19d5b9 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/validation/UpdateQualityNotificationValidator.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/validation/UpdateQualityNotificationValidator.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.application.validation; +package org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import qualitynotification.base.request.UpdateQualityNotificationRequest; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertNotFoundException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertNotFoundException.java deleted file mode 100644 index b7355f2bc9..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertNotFoundException.java +++ /dev/null @@ -1,27 +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.qualitynotification.domain.alert.model.exception; - -public class AlertNotFoundException extends RuntimeException { - - public AlertNotFoundException(String notificationId) { - super("Alert not found for %s notification id".formatted(notificationId)); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java deleted file mode 100644 index 980155d608..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/AlertRepository.java +++ /dev/null @@ -1,25 +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.qualitynotification.domain.base; - -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; - -public interface AlertRepository extends QualityNotificationRepository { -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/InvestigationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/InvestigationRepository.java deleted file mode 100644 index 19de47aea1..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/InvestigationRepository.java +++ /dev/null @@ -1,28 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.domain.base; - -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; - -public interface InvestigationRepository extends QualityNotificationRepository { - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java index 3f47f00766..b5c4d267f6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotification.java @@ -23,8 +23,8 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationStatusTransitionNotAllowed; import java.time.Instant; import java.util.ArrayList; @@ -37,6 +37,7 @@ @Builder(toBuilder = true) @Slf4j public class QualityNotification { + private String title; private BPN bpn; private QualityNotificationId notificationId; private QualityNotificationStatus notificationStatus; @@ -54,20 +55,9 @@ public class QualityNotification { private List notifications = List.of(); - // TODO cleanup afterwards - public static QualityNotification startNotification(Instant createDate, BPN bpn, String description) { // rename to generic - return QualityNotification.builder() - .bpn(bpn) - .notificationStatus(QualityNotificationStatus.CREATED) - .notificationSide(QualityNotificationSide.SENDER) - .description(description) - .createdAt(createDate) - .assetIds(Collections.emptyList()) - .build(); - } - - public static QualityNotification startNotification(Instant createDate, BPN bpn, String description, QualityNotificationType notificationType) { // rename to generic + public static QualityNotification startNotification(String title, Instant createDate, BPN bpn, String description, QualityNotificationType notificationType) { return QualityNotification.builder() + .title(title) .bpn(bpn) .notificationStatus(QualityNotificationStatus.CREATED) .notificationSide(QualityNotificationSide.SENDER) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java index b317d389bc..2de3522bac 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationMessage.java @@ -25,7 +25,7 @@ import org.apache.commons.lang3.StringUtils; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationStatusTransitionNotAllowed; import java.time.Instant; import java.time.LocalDateTime; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java index 7ea57021b3..338bbd138f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationReceiverService.java @@ -26,7 +26,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; @Slf4j diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 6c18fec439..8208ad5dc1 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -23,8 +23,8 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -32,7 +32,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; import org.springframework.data.domain.Pageable; import java.util.ArrayList; @@ -61,6 +61,7 @@ public PageResult getNotifications(Pageable pageable, Searc @Override public QualityNotificationId start(StartQualityNotification startQualityNotification) { QualityNotification notification = notificationPublisherService.startQualityNotification( + startQualityNotification.getTitle(), startQualityNotification.getPartIds(), startQualityNotification.getDescription(), startQualityNotification.getTargetDate(), diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java index b54ecc86c5..8b9484b4e8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java @@ -28,8 +28,6 @@ import org.eclipse.tractusx.traceability.discovery.domain.model.Discovery; import org.eclipse.tractusx.traceability.discovery.domain.service.DiscoveryService; import org.eclipse.tractusx.traceability.discovery.infrastructure.exception.DiscoveryFinderException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoCatalogItemException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoEndpointDataReferenceException; @@ -37,6 +35,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.springframework.context.annotation.Profile; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -57,8 +56,7 @@ public class EdcNotificationServiceImpl implements EdcNotificationService { private final InvestigationsEDCFacade edcFacade; private final DiscoveryService discoveryService; - private final InvestigationRepository investigationRepository; - private final AlertRepository alertRepository; + private final NotificationRepository notificationRepository; @Override @Async(value = AssetsAsyncConfig.UPDATE_NOTIFICATION_EXECUTOR) @@ -119,12 +117,8 @@ private boolean handleSendingNotification(QualityNotificationMessage message, St private void enrichQualityNotificationByError(Exception e, QualityNotificationMessage message) { log.info("Retrieving quality notification by message id {}", message.getEdcNotificationId()); - Optional optionalQualityNotificationById; - if (message.getType().equals(QualityNotificationType.INVESTIGATION)) { - optionalQualityNotificationById = investigationRepository.findByEdcNotificationId(message.getEdcNotificationId()); - } else { - optionalQualityNotificationById = alertRepository.findByEdcNotificationId(message.getEdcNotificationId()); - } + + Optional optionalQualityNotificationById = notificationRepository.findByEdcNotificationId(message.getEdcNotificationId()); log.info("Successfully executed retrieving quality notification by message id"); if (optionalQualityNotificationById.isPresent()) { @@ -135,11 +129,7 @@ private void enrichQualityNotificationByError(Exception e, QualityNotificationMe qmMessage.setErrorMessage(e.getMessage()); }); - if (message.getType().equals(QualityNotificationType.INVESTIGATION)) { - investigationRepository.updateErrorMessage(optionalQualityNotificationById.get()); - } else { - alertRepository.updateErrorMessage(optionalQualityNotificationById.get()); - } + notificationRepository.updateErrorMessage(optionalQualityNotificationById.get()); } else { log.warn("Quality Notification NOT FOUND for error message enrichment notification id {}", message.getId()); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java index 27f47e18da..735a066c5d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java @@ -36,8 +36,6 @@ import org.eclipse.tractusx.irs.edc.client.model.CatalogItem; import org.eclipse.tractusx.irs.edc.client.policy.PolicyCheckerService; import org.eclipse.tractusx.traceability.common.properties.EdcProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.BadRequestException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoCatalogItemException; @@ -47,6 +45,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationFactory; import org.springframework.beans.factory.annotation.Qualifier; @@ -79,8 +78,7 @@ public class InvestigationsEDCFacade { @Qualifier(EDC_NOTIFICATION_TEMPLATE) private final RestTemplate edcNotificationTemplate; - private final InvestigationRepository investigationRepository; - private final AlertRepository alertRepository; + private final NotificationRepository notificationRepository; private final EDCCatalogFacade edcCatalogFacade; private final ContractNegotiationService contractNegotiationService; @@ -188,18 +186,11 @@ private void sendRequest(final EdcNotificationRequest request, QualityNotificati throw new BadRequestException(format("Control plane responded with: %s", response.getStatusCode())); } else { String edcNotificationId = message.getEdcNotificationId(); - if (message.getType().equals(QualityNotificationType.INVESTIGATION)) { - Optional optionalQualityNotificationById = investigationRepository.findByEdcNotificationId(edcNotificationId); - if (optionalQualityNotificationById.isPresent()) { - optionalQualityNotificationById.ifPresent(investigationRepository::updateQualityNotificationEntity); - log.info("Updated qualitynotification message as investigation with id {}.", optionalQualityNotificationById.get().getNotificationId().value()); - } - } else { - Optional optionalQualityNotificationById = alertRepository.findByEdcNotificationId(edcNotificationId); - if (optionalQualityNotificationById.isPresent()) { - optionalQualityNotificationById.ifPresent(alertRepository::updateQualityNotificationEntity); - log.info("Updated qualitynotification message as alert with id {}.", optionalQualityNotificationById.get().getNotificationId().value()); - } + + Optional optionalQualityNotificationById = notificationRepository.findByEdcNotificationId(edcNotificationId); + if (optionalQualityNotificationById.isPresent()) { + optionalQualityNotificationById.ifPresent(notificationRepository::updateQualityNotificationEntity); + log.info("Updated qualitynotification message as {} with id {}.", message.getType(), optionalQualityNotificationById.get().getNotificationId().value()); } } } catch (Exception e) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java index d879e9a011..a3761a7535 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java @@ -35,7 +35,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.exception.QualityNotificationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotSupportedException; import org.springframework.stereotype.Service; import java.time.Clock; @@ -58,40 +58,10 @@ public class NotificationPublisherService { private final BpnRepository bpnRepository; private final Clock clock; - /** - * Starts a new investigation with the given BPN, asset IDs and description. - * - * @param assetIds the IDs of the assets to investigate - * @param description the description of the investigation - * @param targetDate the targetDate of the investigation - * @param severity the severity of the investigation - * @param isAsBuilt the isAsBuilt of the investigation - * @return the ID of the newly created investigation - */ - // TODO remove - public QualityNotification startQualityNotification(List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, String receiverBpn, boolean isAsBuilt) { - BPN applicationBPN = traceabilityProperties.getBpn(); - QualityNotification notification = QualityNotification.startNotification(clock.instant(), applicationBPN, description); - if (isAsBuilt) { - Map> assetsAsBuiltBPNMap = assetAsBuiltRepository.getAssetsById(assetIds).stream().collect(groupingBy(AssetBase::getManufacturerId)); - assetsAsBuiltBPNMap - .entrySet() - .stream() - .map(it -> { - String creator = getManufacturerNameByBpn(traceabilityProperties.getBpn().value()); - String sendToName = getManufacturerNameByBpn(receiverBpn); - return QualityNotificationMessage.create(applicationBPN, receiverBpn, description, targetDate, severity,QualityNotificationType.INVESTIGATION, it, creator, sendToName); - }) - .forEach(notification::addNotification); - return notification; - } else { - throw new NotificationNotSupportedException(); - } - } - public QualityNotification startQualityNotification(List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, QualityNotificationType type, String receiverBpn, boolean isAsBuilt) { + public QualityNotification startQualityNotification(String title, List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, QualityNotificationType type, String receiverBpn, boolean isAsBuilt) { BPN applicationBPN = traceabilityProperties.getBpn(); - QualityNotification notification = QualityNotification.startNotification(clock.instant(), applicationBPN, description, type); + QualityNotification notification = QualityNotification.startNotification(title, clock.instant(), applicationBPN, description, type); if (isAsBuilt) { Map> assetsAsBuiltBPNMap = assetAsBuiltRepository.getAssetsById(assetIds).stream().collect(groupingBy(AssetBase::getManufacturerId)); assetsAsBuiltBPNMap diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java deleted file mode 100644 index 27935df5df..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationsReceiverService.java +++ /dev/null @@ -1,69 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.common.mapper.NotificationMessageMapper; -import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationReceiverService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; -import org.springframework.stereotype.Component; - -@Slf4j -@RequiredArgsConstructor -@Component -public class InvestigationsReceiverService extends AbstractQualityNotificationReceiverService { - - private final NotificationRepository notificationRepository; - private final NotificationMessageMapper notificationMapper; - private final QualityNotificationMapper qualityNotificationMapper; - - @Override - protected QualityNotificationRepository getRepository() { - return notificationRepository; - } - - @Override - protected NotificationMessageMapper getNotificationMessageMapper() { - return notificationMapper; - } - - @Override - protected QualityNotificationMapper getQualityNotificationMapper() { - return qualityNotificationMapper; - } - - @Override - protected RuntimeException getNotFoundException(String message) { - return new InvestigationNotFoundException(message); - } - - @Override - protected RuntimeException getIllegalUpdateException(String message) { - return new InvestigationIllegalUpdate(message); - } - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationIllegalUpdate.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationIllegalUpdate.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationIllegalUpdate.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationIllegalUpdate.java index 5da981ab48..fbe15f5cbe 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationIllegalUpdate.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationIllegalUpdate.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; public class InvestigationIllegalUpdate extends IllegalArgumentException { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationNotFoundException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationNotFoundException.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationNotFoundException.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationNotFoundException.java index 27346f5565..8298438314 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationNotFoundException.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationNotFoundException.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; public class InvestigationNotFoundException extends RuntimeException { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationReceiverBpnMismatchException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationReceiverBpnMismatchException.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationReceiverBpnMismatchException.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationReceiverBpnMismatchException.java index 2b8d9db9df..36a498b9b4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationReceiverBpnMismatchException.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationReceiverBpnMismatchException.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; import org.eclipse.tractusx.traceability.common.model.BPN; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationStatusTransitionNotAllowed.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationStatusTransitionNotAllowed.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationStatusTransitionNotAllowed.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationStatusTransitionNotAllowed.java index f70fe2fa42..6f62d49472 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/InvestigationStatusTransitionNotAllowed.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/InvestigationStatusTransitionNotAllowed.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertIllegalUpdate.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationIllegalUpdate.java similarity index 86% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertIllegalUpdate.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationIllegalUpdate.java index bf4a394ce7..f87357243d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/exception/AlertIllegalUpdate.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationIllegalUpdate.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; -public class AlertIllegalUpdate extends IllegalArgumentException { +public class NotificationIllegalUpdate extends IllegalArgumentException { - public AlertIllegalUpdate(String message) { + public NotificationIllegalUpdate(String message) { super(message); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotFoundException.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotFoundException.java index f668f13b5e..12b380e3ca 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/NotificationNotFoundException.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotFoundException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; public class NotificationNotFoundException extends RuntimeException{ public NotificationNotFoundException(String notificationId) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationNotSupportedException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotSupportedException.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationNotSupportedException.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotSupportedException.java index 7ecf55bb8a..e7876f18dc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationNotSupportedException.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationNotSupportedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; public class NotificationNotSupportedException extends RuntimeException { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationStatusTransitionNotAllowed.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationStatusTransitionNotAllowed.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationStatusTransitionNotAllowed.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationStatusTransitionNotAllowed.java index a54804ffb0..ff144db632 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/model/exception/NotificationStatusTransitionNotAllowed.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/exception/NotificationStatusTransitionNotAllowed.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/model/StartQualityNotification.java similarity index 95% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/model/StartQualityNotification.java index ff119312a7..e1fb515538 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/model/StartQualityNotification.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/model/StartQualityNotification.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model; import lombok.Builder; import lombok.Data; @@ -34,6 +34,8 @@ @Data public class StartQualityNotification { + private String title; + private List partIds; private String description; @@ -51,6 +53,7 @@ public class StartQualityNotification { public static StartQualityNotification from(StartQualityNotificationRequest startQualityNotificationRequest) { return StartQualityNotification.builder() + .title(startQualityNotificationRequest.getTitle()) .partIds(startQualityNotificationRequest.getPartIds()) .description(startQualityNotificationRequest.getDescription()) .targetDate(startQualityNotificationRequest.getTargetDate()) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java similarity index 92% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java index e2b5a9db6c..04b089a3a2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/NotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.base; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; public interface NotificationRepository extends QualityNotificationRepository { } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/QualityNotificationRepository.java similarity index 99% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/QualityNotificationRepository.java index 785dae311c..534c97a007 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/QualityNotificationRepository.java @@ -19,7 +19,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.repository; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.common.model.PageResult; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationReceiverService.java similarity index 84% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationReceiverService.java index bcf2afdf89..365646954a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertsReceiverService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationReceiverService.java @@ -17,23 +17,23 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.alert.service; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.mapper.NotificationMessageMapper; import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.AlertNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationReceiverService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; import org.springframework.stereotype.Component; @Slf4j @RequiredArgsConstructor @Component -public class AlertsReceiverService extends AbstractQualityNotificationReceiverService { +public class NotificationReceiverService extends AbstractQualityNotificationReceiverService { private final NotificationRepository notificationRepository; private final NotificationMessageMapper notificationMapper; @@ -57,12 +57,12 @@ protected QualityNotificationMapper getQualityNotificationMapper() { @Override protected RuntimeException getNotFoundException(String message) { - return new AlertNotFoundException(message); + return new NotificationNotFoundException(message); } @Override protected RuntimeException getIllegalUpdateException(String message) { - return new AlertIllegalUpdate(message); + return new NotificationIllegalUpdate(message); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationServiceImpl.java similarity index 92% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationServiceImpl.java index 5ef155757d..df2db0429e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/service/NotificationServiceImpl.java @@ -17,14 +17,14 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.domain.service; +package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.AbstractQualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; import org.springframework.stereotype.Service; @Service("notificationServiceImpl") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java deleted file mode 100644 index a18d7ad3da..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertEntity.java +++ /dev/null @@ -1,104 +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.qualitynotification.infrastructure.alert.model; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; -import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; - -import java.util.List; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -@NoArgsConstructor -@Getter -@Setter -@Entity -@SuperBuilder -@Table(name = "alert") -public class AlertEntity extends NotificationBaseEntity { - - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable( - name = "assets_as_built_alerts", - joinColumns = @JoinColumn(name = "alert_id"), - inverseJoinColumns = @JoinColumn(name = "asset_id") - ) - public List assets; - - - @OneToMany(mappedBy = "alert") - private List notifications; - - public static QualityNotification toDomain(AlertEntity alertNotificationEntity) { - List notifications = emptyIfNull(alertNotificationEntity.getNotifications()).stream() - .map(AlertNotificationEntity::toDomain) - .toList(); - - List assetIds = alertNotificationEntity.getAssets().stream() - .map(AssetAsBuiltEntity::getId) - .toList(); - - return QualityNotification.builder() - .notificationId(new QualityNotificationId(alertNotificationEntity.getId())) - .bpn(BPN.of(alertNotificationEntity.getBpn())) - .notificationStatus(QualityNotificationStatus.fromStringValue(alertNotificationEntity.getStatus().name())) - .notificationSide(QualityNotificationSide.valueOf(alertNotificationEntity.getSide().name())) - .closeReason(alertNotificationEntity.getCloseReason()) - .acceptReason(alertNotificationEntity.getAcceptReason()) - .declineReason(alertNotificationEntity.getDeclineReason()) - .createdAt(alertNotificationEntity.getCreatedDate()) - .description(alertNotificationEntity.getDescription()) - .assetIds(assetIds) - .notifications(notifications) - .build(); - } - - public static AlertEntity from(QualityNotification qualityNotification, List assetEntities) { - return AlertEntity.builder() - .assets(assetEntities) - .bpn(qualityNotification.getBpn()) - .description(qualityNotification.getDescription()) - .status(NotificationStatusBaseEntity.fromStringValue(qualityNotification.getNotificationStatus().name())) - .side(NotificationSideBaseEntity.valueOf(qualityNotification.getNotificationSide().name())) - .createdDate(qualityNotification.getCreatedAt()) - .build(); - } - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java deleted file mode 100644 index a300eb38a5..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/model/AlertNotificationEntity.java +++ /dev/null @@ -1,113 +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.qualitynotification.infrastructure.alert.model; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; -import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.QualityNotificationMessageBaseEntity; - -import java.util.List; - -@Setter -@Getter -@SuperBuilder -@AllArgsConstructor -@NoArgsConstructor -@Entity -@Table(name = "alert_notification") -public class AlertNotificationEntity extends QualityNotificationMessageBaseEntity { - - @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) - @JoinColumn(name = "alert_id") - private AlertEntity alert; - - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable( - name = "asset_as_built_alert_notifications", - joinColumns = @JoinColumn(name = "alert_notification_id"), - inverseJoinColumns = @JoinColumn(name = "asset_id") - ) - private List assets; - - public static QualityNotificationMessage toDomain(AlertNotificationEntity alertNotificationEntity) { - return QualityNotificationMessage.builder() - .id(alertNotificationEntity.getId()) - .notificationReferenceId(alertNotificationEntity.getNotificationReferenceId()) - .createdBy(alertNotificationEntity.getCreatedBy()) - .createdByName(alertNotificationEntity.getCreatedByName()) - .sendTo(alertNotificationEntity.getSendTo()) - .sendToName(alertNotificationEntity.getSendToName()) - .description(alertNotificationEntity.getAlert().getDescription()) - .contractAgreementId(alertNotificationEntity.getContractAgreementId()) - .notificationStatus(QualityNotificationStatus.fromStringValue(alertNotificationEntity.getStatus().name())) - .affectedParts(alertNotificationEntity.getAssets().stream() - .map(asset -> new QualityNotificationAffectedPart(asset.getId())) - .toList()) - .targetDate(alertNotificationEntity.getTargetDate()) - .severity(alertNotificationEntity.getSeverity()) - .edcNotificationId(alertNotificationEntity.getEdcNotificationId()) - .messageId(alertNotificationEntity.getMessageId()) - .created(alertNotificationEntity.getCreated()) - .updated(alertNotificationEntity.getUpdated()) - .type(QualityNotificationType.ALERT) - .errorMessage(alertNotificationEntity.getErrorMessage()) - .build(); - } - - public static AlertNotificationEntity from(AlertEntity alertEntity, - QualityNotificationMessage qualityNotificationMessage, - List notificationAssets) { - return AlertNotificationEntity - .builder() - .id(qualityNotificationMessage.getId()) - .alert(alertEntity) - .created(qualityNotificationMessage.getCreated()) - .createdBy(qualityNotificationMessage.getCreatedBy()) - .createdByName(qualityNotificationMessage.getCreatedByName()) - .sendTo(qualityNotificationMessage.getSendTo()) - .sendToName(qualityNotificationMessage.getSendToName()) - .assets(notificationAssets) - .notificationReferenceId(qualityNotificationMessage.getNotificationReferenceId()) - .targetDate(qualityNotificationMessage.getTargetDate()) - .errorMessage(qualityNotificationMessage.getErrorMessage()) - .severity(qualityNotificationMessage.getSeverity()) - .edcNotificationId(qualityNotificationMessage.getEdcNotificationId()) - .status(NotificationStatusBaseEntity.fromStringValue(qualityNotificationMessage.getNotificationStatus().name())) - .messageId(qualityNotificationMessage.getMessageId()) - .build(); - } - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertSpecification.java deleted file mode 100644 index bc8baabd7a..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertSpecification.java +++ /dev/null @@ -1,42 +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.qualitynotification.infrastructure.alert.repository; - -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; -import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.jetbrains.annotations.NotNull; -import org.springframework.data.jpa.domain.Specification; - -public class AlertSpecification extends BaseSpecification implements Specification { - - public AlertSpecification(SearchCriteriaFilter criteria) { - super(criteria); - } - - @Override - public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { - return createPredicate(getSearchCriteriaFilter(), root, builder); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java deleted file mode 100644 index 5c4d510c57..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java +++ /dev/null @@ -1,245 +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.qualitynotification.infrastructure.alert.repository; - -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.transaction.Transactional; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; -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.eclipse.tractusx.traceability.common.repository.CriteriaUtility; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.domain.Specification; -import org.springframework.stereotype.Component; - -import java.time.Clock; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -@Slf4j -@RequiredArgsConstructor -@Transactional -@Component -public class AlertsRepositoryImpl implements AlertRepository { - - private final JpaAlertRepository jpaAlertRepository; - - private final JpaAssetAsBuiltRepository assetAsBuiltRepository; - - private final JpaAlertNotificationRepository notificationRepository; - - private final Clock clock; - - @PersistenceContext - private EntityManager entityManager; - - @Override - public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { - List alertsSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream() - .map(AlertSpecification::new) - .toList(); - Specification specification = AlertSpecification.toSpecification(alertsSpecifications); - return new PageResult<>(jpaAlertRepository.findAll(specification, pageable), AlertEntity::toDomain); - } - - @Override - public void updateQualityNotificationEntity(QualityNotification alert) { - AlertEntity alertEntity = jpaAlertRepository.findById(alert.getNotificationId().value()) - .orElseThrow(() -> new IllegalArgumentException(String.format("Alert with id %s not found!", alert.getNotificationId().value()))); - - alertEntity.setStatus(NotificationStatusBaseEntity.fromStringValue(alert.getNotificationStatus().name())); - alertEntity.setUpdated(clock.instant()); - alertEntity.setCloseReason(alert.getCloseReason()); - alertEntity.setAcceptReason(alert.getAcceptReason()); - alertEntity.setDeclineReason(alert.getDeclineReason()); - - handleNotificationUpdate(alertEntity, alert); - jpaAlertRepository.save(alertEntity); - } - - @Override - public void updateErrorMessage(QualityNotification alert) { - - AlertEntity alertEntity = jpaAlertRepository.findById(alert.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", alert.getNotificationId().value()))); - - for (QualityNotificationMessage notification : alert.getNotifications()) { - List assetEntitiesByAlert = getAssetAsBuiltEntitiesByAlert(alert); - AlertNotificationEntity notificationEntity = toNotificationEntity(alertEntity, notification, assetEntitiesByAlert); - Optional optionalNotification = notificationRepository.findById(notificationEntity.getId()); - optionalNotification.ifPresentOrElse(alertNotificationEntity -> { - alertNotificationEntity.setErrorMessage(notification.getErrorMessage()); - alertNotificationEntity.setUpdated(LocalDateTime.ofInstant(clock.instant(), clock.getZone())); - notificationRepository.save(notificationEntity); - - }, () -> log.info("Could not find notification by id {}. Error could not be enriched {}", notification.getId(), notification.getErrorMessage())); - } - jpaAlertRepository.save(alertEntity); - } - - @Override - public QualityNotificationId saveQualityNotificationEntity(QualityNotification alert) { - - List assetAsBuiltEntities = getAssetAsBuiltEntitiesByAlert(alert); - - if (assetAsBuiltEntities.isEmpty()) { - throw new IllegalArgumentException("No assets found for %s asset ids".formatted(String.join(", ", alert.getAssetIds()))); - } - - AlertEntity alertEntity = AlertEntity.from(alert, assetAsBuiltEntities); - jpaAlertRepository.save(alertEntity); - alert.getNotifications() - .forEach(notification -> handleNotificationCreate(alertEntity, notification, assetAsBuiltEntities)); - return new QualityNotificationId(alertEntity.getId()); - } - - @Override - public Optional findOptionalQualityNotificationById(QualityNotificationId alertId) { - return jpaAlertRepository.findById(alertId.value()) - .map(AlertEntity::toDomain); - } - - @Override - public Optional findByNotificationMessageId(String id) { - return jpaAlertRepository.findByNotificationMessageId(id).map(AlertEntity::toDomain); - } - - @Override - public long countOpenNotificationsByOwnership(List owners) { - return jpaAlertRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)) - .stream() - .map(AlertEntity::getAssets) - .flatMap(Collection::stream) - .filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())) - .distinct() - .toList().size(); - } - - @Override - public long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType) { - return 0; - } - - @Override - public Optional findByEdcNotificationId(String edcNotificationId) { - return jpaAlertRepository.findByNotificationsEdcNotificationId(edcNotificationId) - .map(AlertEntity::toDomain); - } - - @Override - public long countQualityNotificationEntitiesBySide(QualityNotificationSide alertSide) { - return jpaAlertRepository.countAllBySideEquals(NotificationSideBaseEntity.valueOf(alertSide.name())); - } - - @Override - public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide investigationSide, QualityNotificationType notificationType) { - return 0; - } - - private void handleNotificationUpdate(AlertEntity alertEntity, QualityNotification alert) { - - List notificationEntities = new ArrayList<>(alertEntity.getNotifications()); - Map notificationEntityMap = notificationEntities.stream().collect(Collectors.toMap(AlertNotificationEntity::getId, notificationEntity -> notificationEntity)); - for (QualityNotificationMessage notification : alert.getNotifications()) { - if (notificationExists(alertEntity, notification.getId())) { - log.info("handleNotificationUpdate::notificationExists with id {} for alert with id {}", notification.getId(), alert.getNotificationId()); - handleNotificationUpdate(notificationEntityMap.get(notification.getId()), notification); - } else { - log.info("handleNotificationUpdate::new notification with id {} for alert with id {}", notification.getId(), alert.getNotificationId()); - List assetAsBuiltEntitiesByAlert = getAssetAsBuiltEntitiesByAlert(alert); - handleNotificationCreate(alertEntity, notification, assetAsBuiltEntitiesByAlert); - } - } - - } - - private List getAssetAsBuiltEntitiesByAlert(QualityNotification alert) { - return assetAsBuiltRepository.findByIdIn(alert.getAssetIds()); - } - - private void handleNotificationCreate(AlertEntity alertEntity, QualityNotificationMessage notificationDomain, - List assetEntities) { - AlertNotificationEntity notificationEntity = toNotificationEntity(alertEntity, notificationDomain, assetEntities); - AlertNotificationEntity savedEntity = notificationRepository.save(notificationEntity); - log.info("Successfully persisted alert notification entity {}", savedEntity); - } - - private boolean notificationExists(AlertEntity alertEntity, String notificationId) { - List notificationEntities = new ArrayList<>(alertEntity.getNotifications()); - return notificationEntities.stream().anyMatch(notification -> notification.getId().equals(notificationId)); - } - - private void handleNotificationUpdate(AlertNotificationEntity notificationEntity, QualityNotificationMessage notification) { - notificationEntity.setContractAgreementId(notification.getContractAgreementId()); - notificationEntity.setNotificationReferenceId(notification.getNotificationReferenceId()); - notificationEntity.setTargetDate(notification.getTargetDate()); - notificationRepository.save(notificationEntity); - } - - - private AlertNotificationEntity toNotificationEntity(AlertEntity alertEntity, QualityNotificationMessage notification, List alertAssets) { - List filteredAsBuiltAssets = filterNotificationAssets(notification, alertAssets); - - if (filteredAsBuiltAssets.isEmpty()) { - throw new IllegalStateException(" with id %s has no notification assets".formatted(alertEntity.getId())); - } - return AlertNotificationEntity.from(alertEntity, notification, filteredAsBuiltAssets); - } - - private List filterNotificationAssets(QualityNotificationMessage notification, List assets) { - Set notificationAffectedAssetIds = notification.getAffectedParts().stream() - .map(QualityNotificationAffectedPart::assetId) - .collect(Collectors.toSet()); - - return assets.stream() - .filter(it -> notificationAffectedAssetIds.contains(it.getId())) - .toList(); - } - - @Override - public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { - return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, AlertEntity.class, entityManager); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertNotificationRepository.java deleted file mode 100644 index e2ea3dc022..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertNotificationRepository.java +++ /dev/null @@ -1,29 +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.qualitynotification.infrastructure.alert.repository; - -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface JpaAlertNotificationRepository extends JpaRepository { - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java deleted file mode 100644 index f081de1363..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/JpaAlertRepository.java +++ /dev/null @@ -1,52 +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.qualitynotification.infrastructure.alert.repository; - -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Optional; - -@Repository -public interface JpaAlertRepository extends JpaRepository, JpaSpecificationExecutor { - - Page findAllBySideEquals(NotificationSideBaseEntity investigationSide, Pageable pageable); - - long countAllByStatusEquals(NotificationStatusBaseEntity status); - - long countAllBySideEquals(NotificationSideBaseEntity alertSide); - - @Query("SELECT alert FROM AlertEntity alert JOIN alert.notifications notification WHERE notification.edcNotificationId = :edcNotificationId") - Optional findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); - - @Query("SELECT alert FROM AlertEntity alert JOIN alert.notifications notification WHERE notification.id = :id") - Optional findByNotificationMessageId(@Param("id") String id); - - List findAllByStatusIn(List statuses); -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EDCNotificationValidator.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EDCNotificationValidator.java index 543f718424..da2efa92c6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EDCNotificationValidator.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EDCNotificationValidator.java @@ -24,7 +24,7 @@ import org.eclipse.tractusx.traceability.common.model.BPN; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationReceiverBpnMismatchException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationReceiverBpnMismatchException; import org.springframework.stereotype.Component; /** diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java index d06d6720c4..8276c57edc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/edc/EdcController.java @@ -31,10 +31,9 @@ import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.service.AlertsReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service.InvestigationsReceiverService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.NotificationType; import org.springframework.validation.annotation.Validated; @@ -51,8 +50,7 @@ @RequiredArgsConstructor public class EdcController { - private final InvestigationsReceiverService investigationsReceiverService; - private final AlertsReceiverService alertsReceiverService; + private final NotificationReceiverService notificationReceiverService; /** * Receiver API call for EDC Transfer @@ -111,7 +109,7 @@ public void qualityNotificationInvestigationReceive(final @ValidEDCNotification EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityNotificationReceive] notificationId:{}", cleanEdcNotification); validateIsQualityInvestigation(cleanEdcNotification); - investigationsReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.INVESTIGATION); + notificationReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.INVESTIGATION); } /** @@ -172,7 +170,7 @@ public void qualityNotificationInvestigationUpdate(final @ValidEDCNotification @ EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityNotificationUpdate] notificationId:{}", cleanEdcNotification); validateIsQualityInvestigation(cleanEdcNotification); - investigationsReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.INVESTIGATION); + notificationReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.INVESTIGATION); } /** @@ -232,7 +230,7 @@ public void qualityNotificationAlertReceive(final @ValidEDCNotification @Valid @ EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityalertReceive] notificationId:{}", cleanEdcNotification); validateIsAlert(cleanEdcNotification); - alertsReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.ALERT); + notificationReceiverService.handleReceive(cleanEdcNotification, QualityNotificationType.ALERT); } /** @@ -292,7 +290,7 @@ public void qualityNotificationAlertUpdate(final @ValidEDCNotification @Valid @R EDCNotification cleanEdcNotification = sanitize(edcNotification); log.info("EdcController [qualityalertUpdate] notificationId:{}", cleanEdcNotification); validateIsAlert(cleanEdcNotification); - alertsReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.ALERT); + notificationReceiverService.handleUpdate(cleanEdcNotification, QualityNotificationType.ALERT); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationEntity.java deleted file mode 100644 index 9df7578063..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationEntity.java +++ /dev/null @@ -1,107 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; -import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; - -import java.util.List; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -@NoArgsConstructor -@Getter -@Setter -@Entity -@SuperBuilder -@Table(name = "investigation") -public class InvestigationEntity extends NotificationBaseEntity { - - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable( - name = "assets_as_built_investigations", - joinColumns = @JoinColumn(name = "investigation_id"), - inverseJoinColumns = @JoinColumn(name = "asset_id") - ) - private List assets; - - - @OneToMany(mappedBy = "investigation") - private List notifications; - - - public static QualityNotification toDomain(InvestigationEntity investigationEntity) { - List notifications = emptyIfNull(investigationEntity.getNotifications()).stream() - .map(InvestigationNotificationEntity::toDomain) - .toList(); - - List assetIds = investigationEntity.getAssets().stream() - .map(AssetAsBuiltEntity::getId) - .toList(); - - return QualityNotification.builder() - .notificationId(new QualityNotificationId(investigationEntity.getId())) - .bpn(BPN.of(investigationEntity.getBpn())) - .notificationStatus(QualityNotificationStatus.fromStringValue(investigationEntity.getStatus().name())) - .notificationSide(QualityNotificationSide.valueOf(investigationEntity.getSide().name())) - .closeReason(investigationEntity.getCloseReason()) - .acceptReason(investigationEntity.getAcceptReason()) - .declineReason(investigationEntity.getDeclineReason()) - .createdAt(investigationEntity.getCreatedDate()) - .description(investigationEntity.getDescription()) - .assetIds(assetIds) - .notifications(notifications) - .build(); - } - - public static InvestigationEntity from(QualityNotification qualityNotification, List assetEntities) { - return InvestigationEntity.builder() - .assets(assetEntities) - .bpn(qualityNotification.getBpn()) - .description(qualityNotification.getDescription()) - .status(NotificationStatusBaseEntity.fromStringValue(qualityNotification.getNotificationStatus().name())) - .side(NotificationSideBaseEntity.valueOf(qualityNotification.getNotificationSide().name())) - .createdDate(qualityNotification.getCreatedAt()) - .build(); - } - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java deleted file mode 100644 index be429f11f0..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/model/InvestigationNotificationEntity.java +++ /dev/null @@ -1,114 +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.qualitynotification.infrastructure.investigation.model; - -import jakarta.persistence.CascadeType; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.experimental.SuperBuilder; -import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.QualityNotificationMessageBaseEntity; - -import java.util.List; - -@Setter -@Getter -@SuperBuilder -@AllArgsConstructor -@NoArgsConstructor -@Entity -@Table(name = "investigation_notification") -public class InvestigationNotificationEntity extends QualityNotificationMessageBaseEntity { - - @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) - @JoinColumn(name = "investigation_id") - private InvestigationEntity investigation; - - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable( - name = "assets_as_built_notifications", - joinColumns = @JoinColumn(name = "notification_id"), - inverseJoinColumns = @JoinColumn(name = "asset_id") - ) - private List assets; - - public static QualityNotificationMessage toDomain(InvestigationNotificationEntity investigationNotificationEntity) { - return QualityNotificationMessage.builder() - .id(investigationNotificationEntity.getId()) - .notificationReferenceId(investigationNotificationEntity.getNotificationReferenceId()) - .createdBy(investigationNotificationEntity.getCreatedBy()) - .createdByName(investigationNotificationEntity.getCreatedByName()) - .sendTo(investigationNotificationEntity.getSendTo()) - .sendToName(investigationNotificationEntity.getSendToName()) - .description(investigationNotificationEntity.getInvestigation().getDescription()) - .contractAgreementId(investigationNotificationEntity.getContractAgreementId()) - .notificationStatus(QualityNotificationStatus.fromStringValue(investigationNotificationEntity.getStatus().name())) - .affectedParts(investigationNotificationEntity.getAssets().stream() - .map(asset -> new QualityNotificationAffectedPart(asset.getId())) - .toList()) - .targetDate(investigationNotificationEntity.getTargetDate()) - .severity(investigationNotificationEntity.getSeverity()) - .edcNotificationId(investigationNotificationEntity.getEdcNotificationId()) - .messageId(investigationNotificationEntity.getMessageId()) - .created(investigationNotificationEntity.getCreated()) - .updated(investigationNotificationEntity.getUpdated()) - .type(QualityNotificationType.INVESTIGATION) - .errorMessage(investigationNotificationEntity.getErrorMessage()) - .build(); - } - - public static InvestigationNotificationEntity from(InvestigationEntity investigationEntity, - QualityNotificationMessage qualityNotificationMessage, - List notificationAssets) { - return InvestigationNotificationEntity - .builder() - .id(qualityNotificationMessage.getId()) - .investigation(investigationEntity) - .errorMessage(qualityNotificationMessage.getErrorMessage()) - .contractAgreementId(qualityNotificationMessage.getContractAgreementId()) - .created(qualityNotificationMessage.getCreated()) - .createdBy(qualityNotificationMessage.getCreatedBy()) - .createdByName(qualityNotificationMessage.getCreatedByName()) - .sendTo(qualityNotificationMessage.getSendTo()) - .sendToName(qualityNotificationMessage.getSendToName()) - .assets(notificationAssets) - .notificationReferenceId(qualityNotificationMessage.getNotificationReferenceId()) - .targetDate(qualityNotificationMessage.getTargetDate()) - .severity(qualityNotificationMessage.getSeverity()) - .edcNotificationId(qualityNotificationMessage.getEdcNotificationId()) - .status(NotificationStatusBaseEntity.fromStringValue(qualityNotificationMessage.getNotificationStatus().name())) - .messageId(qualityNotificationMessage.getMessageId()) - .build(); - } - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationSpecification.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationSpecification.java deleted file mode 100644 index 17a8acd862..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationSpecification.java +++ /dev/null @@ -1,42 +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.qualitynotification.infrastructure.investigation.repository; - -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; -import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; -import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.jetbrains.annotations.NotNull; -import org.springframework.data.jpa.domain.Specification; - -public class InvestigationSpecification extends BaseSpecification implements Specification { - - public InvestigationSpecification(SearchCriteriaFilter criteria) { - super(criteria); - } - - @Override - public Predicate toPredicate(@NotNull Root root, @NotNull CriteriaQuery query, @NotNull CriteriaBuilder builder) { - return createPredicate(getSearchCriteriaFilter(), root, builder); - } -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java deleted file mode 100644 index c372355cce..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java +++ /dev/null @@ -1,222 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository; - -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.transaction.Transactional; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -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.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; -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.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.domain.Specification; -import org.springframework.stereotype.Component; - -import java.time.Clock; -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import static org.apache.commons.collections4.ListUtils.emptyIfNull; - -@Slf4j -@RequiredArgsConstructor -@Component -@Transactional -public class InvestigationsRepositoryImpl implements InvestigationRepository { - - private final JpaInvestigationRepository jpaInvestigationRepository; - - private final JpaAssetAsBuiltRepository assetsRepository; - - private final JpaInvestigationNotificationRepository notificationRepository; - - private final Clock clock; - - @PersistenceContext - private EntityManager entityManager; - - @Override - public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { - List investigationSpecifications = emptyIfNull(searchCriteria.getSearchCriteriaFilterList()).stream().map(InvestigationSpecification::new).toList(); - Specification specification = InvestigationSpecification.toSpecification(investigationSpecifications); - return new PageResult<>(jpaInvestigationRepository.findAll(specification, pageable), InvestigationEntity::toDomain); - } - - @Override - public long countOpenNotificationsByOwnership(List owners) { - return jpaInvestigationRepository.findAllByStatusIn(NotificationStatusBaseEntity.from(QualityNotificationStatus.ACTIVE_STATES)).stream().map(InvestigationEntity::getAssets).flatMap(Collection::stream).filter(assetAsBuiltEntity -> owners.contains(assetAsBuiltEntity.getOwner())).distinct().toList().size(); - } - - @Override - public long countOpenNotificationsByOwnershipAndNotificationType(List owners, QualityNotificationType notificationType) { - return 0; - } - - @Override - public void updateQualityNotificationEntity(QualityNotification investigation) { - InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); - - investigationEntity.setStatus(NotificationStatusBaseEntity.fromStringValue(investigation.getNotificationStatus().name())); - investigationEntity.setUpdated(clock.instant()); - investigationEntity.setCloseReason(investigation.getCloseReason()); - investigationEntity.setAcceptReason(investigation.getAcceptReason()); - investigationEntity.setDeclineReason(investigation.getDeclineReason()); - handleNotificationUpdate(investigationEntity, investigation); - jpaInvestigationRepository.save(investigationEntity); - } - - @Override - public void updateErrorMessage(QualityNotification investigation) { - log.info("Starting update of error message with investigation {}", investigation); - InvestigationEntity investigationEntity = jpaInvestigationRepository.findById(investigation.getNotificationId().value()).orElseThrow(() -> new IllegalArgumentException(String.format("Investigation with id %s not found!", investigation.getNotificationId().value()))); - - for (QualityNotificationMessage notification : investigation.getNotifications()) { - List assetEntitiesByInvestigation = getAssetEntitiesByInvestigation(investigation); - InvestigationNotificationEntity notificationEntity = toNotificationEntity(investigationEntity, notification, assetEntitiesByInvestigation); - Optional optionalNotification = notificationRepository.findById(notificationEntity.getId()); - optionalNotification.ifPresentOrElse(investigationNotificationEntity -> { - investigationNotificationEntity.setErrorMessage(notification.getErrorMessage()); - investigationNotificationEntity.setUpdated(LocalDateTime.ofInstant(clock.instant(), clock.getZone())); - notificationRepository.save(notificationEntity); - log.info("Update of error message with notificationEntity {}", notificationEntity); - }, () -> log.info("Could not find notification by id {}. Error could not be enriched {}", notification.getId(), notification.getErrorMessage())); - } - jpaInvestigationRepository.save(investigationEntity); - } - - @Override - public QualityNotificationId saveQualityNotificationEntity(QualityNotification investigation) { - - List assetEntities = getAssetEntitiesByInvestigation(investigation); - - if (!assetEntities.isEmpty()) { - InvestigationEntity investigationEntity = InvestigationEntity.from(investigation, assetEntities); - - jpaInvestigationRepository.save(investigationEntity); - - investigation.getNotifications().forEach(notification -> handleNotificationCreate(investigationEntity, notification, assetEntities)); - - return new QualityNotificationId(investigationEntity.getId()); - } else { - throw new IllegalArgumentException("No assets found for %s asset ids".formatted(String.join(", ", investigation.getAssetIds()))); - } - } - - @Override - public Optional findOptionalQualityNotificationById(QualityNotificationId investigationId) { - return jpaInvestigationRepository.findById(investigationId.value()).map(InvestigationEntity::toDomain); - } - - @Override - public Optional findByEdcNotificationId(String edcNotificationId) { - return jpaInvestigationRepository.findByNotificationsEdcNotificationId(edcNotificationId).map(InvestigationEntity::toDomain); - } - - @Override - public Optional findByNotificationMessageId(String id) { - return jpaInvestigationRepository.findByNotificationMessageId(id).map(InvestigationEntity::toDomain); - } - - @Override - public long countQualityNotificationEntitiesBySide(QualityNotificationSide investigationSide) { - return jpaInvestigationRepository.countAllBySideEquals(NotificationSideBaseEntity.valueOf(investigationSide.name())); - } - - @Override - public long countQualityNotificationEntitiesBySideAndNotificationType(QualityNotificationSide investigationSide, QualityNotificationType notificationType) { - return 0; - } - - private void handleNotificationUpdate(InvestigationEntity investigationEntity, QualityNotification investigation) { - for (QualityNotificationMessage notification : investigation.getNotifications()) { - List assetEntitiesByInvestigation = getAssetEntitiesByInvestigation(investigation); - handleNotificationCreate(investigationEntity, notification, assetEntitiesByInvestigation); - } - - } - - private List getAssetEntitiesByInvestigation(QualityNotification investigation) { - return assetsRepository.findByIdIn(investigation.getAssetIds()); - } - - private void handleNotificationCreate(InvestigationEntity investigationEntity, QualityNotificationMessage notificationDomain, List assetEntities) { - InvestigationNotificationEntity notificationEntity = toNotificationEntity(investigationEntity, notificationDomain, assetEntities); - - Optional optionalNotification = notificationRepository.findById(notificationEntity.getId()); - - optionalNotification.ifPresentOrElse( - // If present - investigationNotificationEntity -> log.info("Investigation has the following old notification with id {} and status {}", investigationNotificationEntity.getId(), investigationNotificationEntity.getStatus().name()), - // If not present - () -> { - // Persist - log.info("Investigation has the following new notification with id {} and status {}", notificationEntity.getId(), notificationEntity.getStatus().name()); - notificationRepository.save(notificationEntity); - log.info("Successfully persisted notification entity {}", notificationEntity); - }); - - } - - private InvestigationNotificationEntity toNotificationEntity(InvestigationEntity investigationEntity, QualityNotificationMessage notification, List investigationAssets) { - List notificationAssets = filterNotificationAssets(notification, investigationAssets); - - if (notificationAssets.isEmpty()) { - throw new IllegalStateException("Investigation with id %s has no notification assets".formatted(investigationEntity.getId())); - } - return InvestigationNotificationEntity.from(investigationEntity, notification, notificationAssets); - } - - private List filterNotificationAssets(QualityNotificationMessage notification, List assets) { - Set notificationAffectedAssetIds = notification.getAffectedParts().stream().map(QualityNotificationAffectedPart::assetId).collect(Collectors.toSet()); - - return assets.stream().filter(it -> notificationAffectedAssetIds.contains(it.getId())).toList(); - } - - @Override - public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { - return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, InvestigationEntity.class, entityManager); - } - - -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java deleted file mode 100644 index 667951efcc..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationNotificationRepository.java +++ /dev/null @@ -1,28 +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.qualitynotification.infrastructure.investigation.repository; - -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface JpaInvestigationNotificationRepository extends JpaRepository { -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java deleted file mode 100644 index d0d09117af..0000000000 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/JpaInvestigationRepository.java +++ /dev/null @@ -1,48 +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 - ********************************************************************************/ - -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository; - -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Optional; - -@Repository -public interface JpaInvestigationRepository extends JpaRepository, JpaSpecificationExecutor { - - long countAllBySideEquals(NotificationSideBaseEntity investigationSide); - - @Query("SELECT investigation FROM InvestigationEntity investigation JOIN investigation.notifications notification WHERE notification.edcNotificationId = :edcNotificationId") - Optional findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); - - @Query("SELECT investigation FROM InvestigationEntity investigation JOIN investigation.notifications notification WHERE notification.id = :id") - Optional findByNotificationMessageId(@Param("id") String id); - - List findAllByStatusIn(List statuses); -} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationBaseEntity.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationBaseEntity.java index f103689f44..6ed9bcd686 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationBaseEntity.java @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; import jakarta.persistence.Column; import jakarta.persistence.EnumType; @@ -39,6 +39,7 @@ public class NotificationBaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; + private String title; private String bpn; private String closeReason; private String acceptReason; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java index 7230f22ca9..39e39742df 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationEntity.java @@ -40,10 +40,6 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; import java.util.List; @@ -81,6 +77,7 @@ public static QualityNotification toDomain(NotificationEntity notificationEntity .map(AssetAsBuiltEntity::getId) .toList(); return QualityNotification.builder() + .title(notificationEntity.getTitle()) .notificationId(new QualityNotificationId(notificationEntity.getId())) .bpn(BPN.of(notificationEntity.getBpn())) .notificationStatus(QualityNotificationStatus.fromStringValue(notificationEntity.getStatus().name())) @@ -98,6 +95,7 @@ public static QualityNotification toDomain(NotificationEntity notificationEntity public static NotificationEntity from(QualityNotification notification, List assetEntities) { return NotificationEntity.builder() + .title(notification.getTitle()) .assets(assetEntities) .bpn(notification.getBpn()) .description(notification.getDescription()) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/QualityNotificationMessageBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageBaseEntity.java similarity index 96% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/QualityNotificationMessageBaseEntity.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageBaseEntity.java index 653541eb02..5beb6e75f7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/QualityNotificationMessageBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageBaseEntity.java @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; @@ -35,7 +35,7 @@ @NoArgsConstructor @Data @MappedSuperclass -public class QualityNotificationMessageBaseEntity { +public class NotificationMessageBaseEntity { @Id private String id; private String createdBy; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java index f9ce6ca10b..e0e1b368b6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationMessageEntity.java @@ -36,11 +36,6 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.QualityNotificationMessageBaseEntity; import java.util.List; @@ -51,7 +46,7 @@ @NoArgsConstructor @Entity @Table(name = "notification_message") -public class NotificationMessageEntity extends QualityNotificationMessageBaseEntity { +public class NotificationMessageEntity extends NotificationMessageBaseEntity { @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "notification_id") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationSideBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationSideBaseEntity.java similarity index 96% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationSideBaseEntity.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationSideBaseEntity.java index b3ed03a796..b760d88b1c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationSideBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationSideBaseEntity.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; public enum NotificationSideBaseEntity { SENDER, diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationStatusBaseEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationStatusBaseEntity.java similarity index 99% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationStatusBaseEntity.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationStatusBaseEntity.java index d552a9685e..592c53bf6d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationStatusBaseEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationStatusBaseEntity.java @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationTypeEntity.java similarity index 97% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationTypeEntity.java index bdd431d81e..c2ea6cd95b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/model/NotificationTypeEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/model/NotificationTypeEntity.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ -package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model; +package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java index b09d416aa0..e7c0db3938 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java @@ -19,9 +19,9 @@ package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java index c0af54c786..52c7dac234 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java @@ -30,7 +30,6 @@ 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.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -38,9 +37,10 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.springframework.data.domain.Pageable; diff --git a/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql index d9ead71f28..a73d8b496f 100644 --- a/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql +++ b/tx-backend/src/main/resources/db/migration/V20__merge_alert_and_notification_tables.sql @@ -17,6 +17,7 @@ DROP SEQUENCE public.investigation_id_seq; CREATE TABLE public.notification ( id int8 NOT NULL GENERATED BY DEFAULT AS IDENTITY ( INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1 NO CYCLE), + title varchar(255) NULL, bpn varchar(255) NULL, close_reason varchar(1000) NULL, created timestamp NULL, @@ -57,18 +58,18 @@ CREATE TABLE public.notification_message CREATE TABLE public.assets_as_planned_notifications ( notification_id int8 NOT NULL, - asset_id varchar(255) NOT NULL + asset_id varchar(255) NOT NULL ); CREATE TABLE public.assets_as_planned_notification_messages ( notification_message_id varchar(255) NOT NULL, - asset_id varchar(255) NOT NULL + asset_id varchar(255) NOT NULL ); CREATE TABLE public.assets_as_built_notifications ( notification_id int8 NOT NULL, - asset_id varchar(255) NOT NULL, + asset_id varchar(255) NOT NULL, CONSTRAINT fk_asset_entity FOREIGN KEY (asset_id) REFERENCES public.assets_as_built (id), CONSTRAINT fk_assets_as_built_notifications FOREIGN KEY (notification_id) REFERENCES public.notification (id) ); @@ -78,6 +79,6 @@ CREATE TABLE public.assets_as_built_notifications CREATE TABLE public.assets_as_built_notification_messages ( notification_message_id varchar(255) NOT NULL, - asset_id varchar(255) NOT NULL, + asset_id varchar(255) NOT NULL, CONSTRAINT fk_notification FOREIGN KEY (notification_message_id) REFERENCES public.notification_message (id) ); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfigTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfigTest.java index 40e88514c5..33c0716e91 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfigTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/config/ErrorHandlingConfigTest.java @@ -31,14 +31,14 @@ import org.eclipse.tractusx.traceability.bpn.domain.model.BpnNotFoundException; import org.eclipse.tractusx.traceability.common.security.TechnicalUserAuthorizationException; import org.eclipse.tractusx.traceability.qualitynotification.application.contract.model.CreateNotificationContractException; -import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation.UpdateQualityNotificationValidationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationReceiverBpnMismatchException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationReceiverBpnMismatchException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationStatusTransitionNotAllowed; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.core.MethodParameter; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/validators/EDCNotificationValidatorTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/validators/EDCNotificationValidatorTest.java index 654f56c179..ca8718ff92 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/validators/EDCNotificationValidatorTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/validators/EDCNotificationValidatorTest.java @@ -23,7 +23,7 @@ import org.eclipse.tractusx.traceability.common.model.BPN; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationReceiverBpnMismatchException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationReceiverBpnMismatchException; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.EDCNotificationValidator; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java index db6bf2537b..85cfbd9d9a 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/model/EdcNotificationModelTest.java @@ -18,7 +18,6 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.infrastructure.edc.model; -import lombok.val; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationContent; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationHeader; @@ -81,12 +80,22 @@ public void testSanitizeEDCNotification() { @Test public void testSanitizeStartQualityNotificationRequest() { //GIVEN + String title = "Title"; List partIds = new ArrayList<>(); partIds.add("urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978"); partIds.add("urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca979\n"); Instant targetDate = Instant.parse("2023-09-22T14:30:00Z".trim()); QualityNotificationSeverityRequest severity = QualityNotificationSeverityRequest.MINOR; - StartQualityNotificationRequest request = new StartQualityNotificationRequest(partIds, "The description\n", targetDate, severity, true, "BPN00001123123AS\n", QualityNotificationTypeRequest.ALERT); + StartQualityNotificationRequest request = new StartQualityNotificationRequest( + title, + partIds, + "The description\n", + targetDate, + severity, + true, + "BPN00001123123AS\n", + QualityNotificationTypeRequest.ALERT + ); //WHEN diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java index 2960c23abc..9d407f38df 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerByIdIT.java @@ -39,14 +39,14 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACCEPTED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACKNOWLEDGED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CANCELED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CLOSED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CREATED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.DECLINED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACCEPTED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACKNOWLEDGED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CANCELED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CLOSED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CREATED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.DECLINED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.RECEIVED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.junit.jupiter.params.provider.Arguments.arguments; 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 3a37119e60..93b9218484 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 @@ -37,16 +37,16 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity.RECEIVER; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity.SENDER; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACCEPTED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACKNOWLEDGED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CANCELED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CLOSED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CREATED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.DECLINED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity.RECEIVER; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity.SENDER; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACCEPTED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACKNOWLEDGED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CANCELED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CLOSED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CREATED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.DECLINED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.RECEIVED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; class AssetAsBuiltControllerFilteringIT extends IntegrationTestSpecification { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java index a97df9fe07..9a2dd3e119 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java @@ -25,9 +25,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; import org.eclipse.tractusx.traceability.common.security.JwtRole; 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.integration.common.support.NotificationSupport; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.BeforeEach; @@ -49,8 +47,8 @@ import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; import static org.eclipse.tractusx.traceability.common.security.JwtRole.SUPERVISOR; import static org.eclipse.tractusx.traceability.common.security.JwtRole.USER; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.RECEIVED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.params.provider.Arguments.arguments; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java index a97e7f0ba8..e7fecf05e4 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java @@ -20,16 +20,12 @@ package org.eclipse.tractusx.traceability.integration.common.support; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertNotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java index 51dec8eb3d..4c42c320b3 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java @@ -22,10 +22,9 @@ 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.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetsSupport.java index 910ffa85c1..417e31bf38 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetsSupport.java @@ -20,7 +20,6 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository.JpaInvestigationRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,8 +30,6 @@ public class AssetsSupport { @Autowired AssetRepositoryProvider assetRepositoryProvider; - @Autowired - JpaInvestigationRepository jpaInvestigationRepository; public String emptyText() { return ""; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java index 5af001b5bc..94a76a925a 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java @@ -21,11 +21,9 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsRepositoryProvider.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsRepositoryProvider.java index 0e8628f064..2cb2c7f6d7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsRepositoryProvider.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsRepositoryProvider.java @@ -18,14 +18,14 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.integration.common.support; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository.JpaInvestigationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; public interface InvestigationsRepositoryProvider { @Autowired - JpaInvestigationRepository jpaInvestigationRepository = null; + JpaNotificationRepository jpaNotificationRepository = null; - default JpaInvestigationRepository jpaInvestigationRepository() { - return jpaInvestigationRepository; + default JpaNotificationRepository jpaNotificationRepository() { + return jpaNotificationRepository; } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java index d2b74698ab..0be76bb6b3 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationsSupport.java @@ -20,13 +20,10 @@ package org.eclipse.tractusx.traceability.integration.common.support; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.model.AssetAsPlannedEntity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository.JpaInvestigationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +39,7 @@ public class InvestigationsSupport { @Autowired - JpaNotificationRepository jpaInvestigationRepository; + JpaNotificationRepository jpaNotificationRepository; public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity status, List assetsAsBuilt) { return storeInvestigationWithStatusAndAssets(status, assetsAsBuilt, NotificationSideBaseEntity.RECEIVER); @@ -58,33 +55,33 @@ public Long storeInvestigationWithStatusAndAssets(NotificationStatusBaseEntity s .createdDate(Instant.now()) .build(); Long alertId = storedInvestigation(entity); - NotificationEntity savedInvestigation = jpaInvestigationRepository.findById(alertId).get(); + NotificationEntity savedInvestigation = jpaNotificationRepository.findById(alertId).get(); savedInvestigation.setAssets(assetsAsBuilt); - jpaInvestigationRepository.save(savedInvestigation); + jpaNotificationRepository.save(savedInvestigation); return alertId; } public void assertInvestigationsSize(int size) { - List investigations = jpaInvestigationRepository.findAll(); + List investigations = jpaNotificationRepository.findAll(); assertThat(investigations).hasSize(size); } public void assertInvestigationStatus(QualityNotificationStatus investigationStatus) { - jpaInvestigationRepository.findAll().forEach( + jpaNotificationRepository.findAll().forEach( investigation -> assertThat(investigation.getStatus().name()).isEqualTo(investigationStatus.name()) ); } public Long storedInvestigation(NotificationEntity investigation) { - return jpaInvestigationRepository.save(investigation).getId(); + return jpaNotificationRepository.save(investigation).getId(); } public NotificationEntity storedInvestigationFullObject(NotificationEntity investigation) { - return jpaInvestigationRepository.save(investigation); + return jpaNotificationRepository.save(investigation); } public List findAllInvestigations() { - return jpaInvestigationRepository.findAll(); + return jpaNotificationRepository.findAll(); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java index d40e2db060..82c60af707 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationMessageSupport.java @@ -20,7 +20,6 @@ package org.eclipse.tractusx.traceability.integration.common.support; import lombok.RequiredArgsConstructor; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; import org.springframework.stereotype.Component; @@ -34,6 +33,7 @@ public class NotificationMessageSupport { private final JpaNotificationMessageRepository jpaNotificationMessageRepository; + public void assertNotificationsSize(int size) { List notifications = jpaNotificationMessageRepository.findAll(); assertThat(notifications).hasSize(size); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java index 1babdf2200..b3dff74e00 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/NotificationSupport.java @@ -22,14 +22,11 @@ import lombok.RequiredArgsConstructor; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; 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.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.time.Instant; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java index 37e47299d4..feb24b41fc 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/edc/blackbox/EdcControllerIT.java @@ -21,10 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.restassured.http.ContentType; -import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; -import org.eclipse.tractusx.traceability.assets.domain.base.model.QualityType; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; -import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.SemanticDataModelEntity; import org.eclipse.tractusx.traceability.common.security.JwtRole; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; @@ -32,11 +29,9 @@ import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.jose4j.lang.JoseException; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java index 6a47453e53..4ae37339fc 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java @@ -40,14 +40,14 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACCEPTED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACKNOWLEDGED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CANCELED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CLOSED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CREATED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.DECLINED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACCEPTED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACKNOWLEDGED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CANCELED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CLOSED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CREATED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.DECLINED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.RECEIVED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java index 34b588d683..d202ca39e0 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java @@ -33,7 +33,7 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; -import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.service.AlertsReceiverService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; @@ -68,7 +68,7 @@ class PublisherAlertsControllerIT extends IntegrationTestSpecification { ObjectMapper objectMapper; @Autowired - AlertsReceiverService alertsReceiverService; + NotificationReceiverService notificationReceiverService; @Autowired AlertsSupport alertsSupport; @Autowired @@ -110,7 +110,7 @@ void shouldReceiveAlert() { // when - alertsReceiverService.handleReceive(notification, notificationType); + notificationReceiverService.handleReceive(notification, notificationType); // then alertsSupport.assertAlertsSize(1); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java index e832963bfc..39c0a8aacf 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/ReadAlertsControllerIT.java @@ -27,11 +27,9 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.BpnSupport; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.hamcrest.Matchers; @@ -310,7 +308,7 @@ void shouldReturnInvestigationById() throws JoseException { @Test void givenNonExistingSortField_whenGetAlerts_thenBadRequest() throws JoseException { //GIVEN - String sortString= "nonExistingField,ASC"; + String sortString = "nonExistingField,ASC"; //WHEN //THEN diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java index a6bf04f89f..9f7182cbc1 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java @@ -40,14 +40,14 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACCEPTED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.ACKNOWLEDGED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CANCELED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CLOSED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.CREATED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.DECLINED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.RECEIVED; -import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity.SENT; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACCEPTED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.ACKNOWLEDGED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CANCELED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CLOSED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.CREATED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.DECLINED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.RECEIVED; +import static org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity.SENT; import static org.hamcrest.Matchers.equalTo; class InvestigationControllerFilterIT extends IntegrationTestSpecification { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java index fdd9d17693..1df8dce290 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/PublisherInvestigationsControllerIT.java @@ -30,8 +30,6 @@ import org.eclipse.tractusx.traceability.common.security.JwtRole; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; -import org.eclipse.tractusx.traceability.integration.common.support.InvestigationNotificationsSupport; -import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationMessageSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationSupport; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; @@ -39,7 +37,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service.InvestigationsReceiverService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationFactory; import org.hamcrest.Matchers; @@ -68,7 +66,7 @@ class PublisherInvestigationsControllerIT extends IntegrationTestSpecification { @Autowired - InvestigationsReceiverService investigationsReceiverService; + NotificationReceiverService notificationReceiverService; @Autowired AssetsSupport assetsSupport; @@ -112,7 +110,7 @@ void shouldReceiveNotification() { "it", notificationBuild); // when - investigationsReceiverService.handleReceive(notification, notificationType); + notificationReceiverService.handleReceive(notification, notificationType); // then notificationSupport.assertInvestigationsSize(1); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java index abe6e2c7f2..a0bcce7124 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/ReadInvestigationsControllerIT.java @@ -27,11 +27,9 @@ import org.eclipse.tractusx.traceability.integration.common.support.BpnSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationTypeEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; import org.hamcrest.Matchers; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java index 1a27085973..08b0eca11d 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertControllerTest.java @@ -19,7 +19,7 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.alert.rest; -import org.eclipse.tractusx.traceability.qualitynotification.application.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.service.QualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.rest.NotificationController; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; @@ -49,7 +49,7 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.StartQualityNotification.from; +import static org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification.from; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java index e41a923649..52dd2c808b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java @@ -18,13 +18,12 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service; -import org.eclipse.tractusx.traceability.qualitynotification.domain.NotificationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotFoundException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.service.NotificationServiceImpl; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationServiceImpl; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/model/investigation/InvestigationTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/model/investigation/InvestigationTest.java index 95cb203999..9f22b23169 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/model/investigation/InvestigationTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/model/investigation/InvestigationTest.java @@ -26,8 +26,8 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationIllegalUpdate; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationStatusTransitionNotAllowed; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationIllegalUpdate; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.InvestigationStatusTransitionNotAllowed; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java index b98753d762..89fd74a9e6 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java @@ -21,18 +21,16 @@ import org.eclipse.tractusx.traceability.discovery.domain.model.Discovery; import org.eclipse.tractusx.traceability.discovery.domain.service.DiscoveryService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.ContractNegotiationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoCatalogItemException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.NoEndpointDataReferenceException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.EdcNotificationServiceImpl; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.InvestigationsEDCFacade; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -41,7 +39,6 @@ import java.time.Instant; import java.util.List; -import java.util.Optional; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -62,10 +59,8 @@ class EdcNotificationServiceImplTest { private DiscoveryService discoveryService; @Mock - private InvestigationRepository investigationRepository; + private NotificationRepository notificationRepository; - @Mock - private AlertRepository alertRepository; @Test void testNotificationsServiceUpdateAsync() { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java index ee131c0350..c21b8d729e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/InvestigationsReceiverServiceTest.java @@ -22,14 +22,14 @@ import org.eclipse.tractusx.traceability.common.mapper.NotificationMessageMapper; import org.eclipse.tractusx.traceability.common.mapper.QualityNotificationMapper; import org.eclipse.tractusx.traceability.common.model.BPN; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.NotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service.InvestigationsReceiverService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationFactory; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; @@ -65,7 +65,7 @@ class InvestigationsReceiverServiceTest { @InjectMocks - private InvestigationsReceiverService service; + private NotificationReceiverService service; @Test diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java index 981eb8ad6e..5eb7e8b636 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java @@ -24,7 +24,6 @@ import org.eclipse.tractusx.traceability.bpn.domain.service.BpnRepository; import org.eclipse.tractusx.traceability.common.model.BPN; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; @@ -32,10 +31,12 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.exception.QualityNotificationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.EdcNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; -import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.testdata.AssetTestDataFactory; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; import org.junit.jupiter.api.DisplayName; @@ -68,7 +69,7 @@ class NotificationPublisherServiceTest { private NotificationPublisherService notificationPublisherService; @Mock - private InvestigationRepository repository; + private NotificationRepository repository; @Mock private AssetAsBuiltRepository assetRepository; @Mock @@ -85,15 +86,25 @@ class NotificationPublisherServiceTest { @Test void testStartInvestigationSuccessful() { // Given + String title = "title"; String description = "Test investigation"; when(assetRepository.getAssetsById(Arrays.asList("asset-1", "asset-2"))).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); when(traceabilityProperties.getBpn()).thenReturn(BPN.of("bpn-123")); String receiverBpn = "someReceiverBpn"; // When - QualityNotification result = notificationPublisherService.startQualityNotification(Arrays.asList("asset-1", "asset-2"), description, Instant.parse("2022-03-01T12:00:00Z"), QualityNotificationSeverity.MINOR, receiverBpn, true); + QualityNotification result = notificationPublisherService.startQualityNotification( + title, + Arrays.asList("asset-1", "asset-2"), + description, + Instant.parse("2022-03-01T12:00:00Z"), + QualityNotificationSeverity.MINOR, + QualityNotificationType.INVESTIGATION, + receiverBpn, + true); // Then + assertThat(result.getTitle()).isEqualTo(title); assertThat(result.getNotificationStatus()).isEqualTo(QualityNotificationStatus.CREATED); assertThat(result.getDescription()).isEqualTo(description); assertThat(result.getNotificationSide()).isEqualTo(QualityNotificationSide.SENDER); @@ -105,23 +116,41 @@ void testStartInvestigationSuccessful() { @Test void testThrowNotificationNotSupportedException() { // Given + String title = "Title"; String description = "Test investigation"; String receiverBpn = "someReceiverBpn"; // Then - assertThrows(NotificationNotSupportedException.class, () -> notificationPublisherService.startQualityNotification(Arrays.asList("asset-1", "asset-2"), description, Instant.parse("2022-03-01T12:00:00Z"), QualityNotificationSeverity.MINOR, receiverBpn, false)); + assertThrows(NotificationNotSupportedException.class, () -> notificationPublisherService.startQualityNotification( + title, + Arrays.asList("asset-1", "asset-2"), + description, + Instant.parse("2022-03-01T12:00:00Z"), + QualityNotificationSeverity.MINOR, + QualityNotificationType.INVESTIGATION, + receiverBpn, + false)); } @Test void testStartAlertSuccessful() { // Given + String title = "Title"; String description = "Test investigation"; String receiverBPN = "BPN00001"; when(traceabilityProperties.getBpn()).thenReturn(BPN.of("bpn-123")); when(assetRepository.getAssetsById(Arrays.asList("asset-1", "asset-2"))).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); // When - QualityNotification result = notificationPublisherService.startQualityNotification(Arrays.asList("asset-1", "asset-2"), description, Instant.parse("2022-03-01T12:00:00Z"), QualityNotificationSeverity.MINOR, receiverBPN, true); + QualityNotification result = notificationPublisherService.startQualityNotification( + title, + Arrays.asList("asset-1", "asset-2"), + description, + Instant.parse("2022-03-01T12:00:00Z"), + QualityNotificationSeverity.MINOR, + QualityNotificationType.ALERT, + receiverBPN, + true); // Then assertThat(result.getNotificationStatus()).isEqualTo(QualityNotificationStatus.CREATED); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java index 2200842d89..8ee010d926 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImplTest.java @@ -26,8 +26,11 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.NotificationRepositoryImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -49,13 +52,13 @@ class InvestigationsRepositoryImplTest { @InjectMocks - private InvestigationsRepositoryImpl investigationsRepository; + private NotificationRepositoryImpl investigationsRepository; @Mock - private JpaInvestigationRepository jpaInvestigationRepository; + private JpaNotificationRepository jpaNotificationRepository; @Mock - private JpaInvestigationNotificationRepository notificationRepository; + private JpaNotificationMessageRepository jpaNotificationMessageRepository; @Mock private JpaAssetAsBuiltRepository assetsRepository; @@ -70,17 +73,17 @@ void updateErrorMessage() { QualityNotificationMessage message = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).affectedParts(List.of(new QualityNotificationAffectedPart("123"))).build(); QualityNotification qualityNotification = QualityNotification.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).assetIds(List.of("123")).notificationId(new QualityNotificationId(123L)).bpn(BPN.of("ABC")).notifications(List.of(message)).build(); AssetAsBuiltEntity assetAsBuiltEntity = AssetAsBuiltEntity.builder().id("123").build(); - InvestigationEntity entity = InvestigationEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); - InvestigationNotificationEntity notificationEntity = InvestigationNotificationEntity.from(entity, message, List.of(assetAsBuiltEntity)); + NotificationEntity entity = NotificationEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); + NotificationMessageEntity notificationEntity = NotificationMessageEntity.from(entity, message, List.of(assetAsBuiltEntity)); when(assetsRepository.findByIdIn(any())).thenReturn(List.of(assetAsBuiltEntity)); - when(jpaInvestigationRepository.findById(any())).thenReturn(Optional.of(entity)); - when(notificationRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); + when(jpaNotificationRepository.findById(any())).thenReturn(Optional.of(entity)); + when(jpaNotificationMessageRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); when(clock.instant()).thenReturn(Instant.now()); when(clock.getZone()).thenReturn(ZoneId.systemDefault()); // When investigationsRepository.updateErrorMessage(qualityNotification); // Then - verify(notificationRepository, times(1)).save(any()); + verify(jpaNotificationMessageRepository, times(1)).save(any()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/NotificationRepositoryImplTest.java similarity index 76% rename from tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java rename to tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/NotificationRepositoryImplTest.java index 9a744f9d0e..ddc7420e21 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/AlertsRepositoryImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/NotificationRepositoryImplTest.java @@ -26,11 +26,11 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; 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.alert.model.AlertNotificationEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.AlertsRepositoryImpl; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertNotificationRepository; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository.JpaAlertRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationMessageEntity; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationMessageRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.JpaNotificationRepository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository.NotificationRepositoryImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -49,16 +49,16 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class AlertsRepositoryImplTest { +class NotificationRepositoryImplTest { @InjectMocks - private AlertsRepositoryImpl alertRepository; + private NotificationRepositoryImpl notificationRepository; @Mock - private JpaAlertRepository jpaAlertRepository; + private JpaNotificationRepository jpaNotificationRepository; @Mock - private JpaAlertNotificationRepository notificationRepository; + private JpaNotificationMessageRepository jpaNotificationMessageRepository; @Mock private JpaAssetAsBuiltRepository assetsRepository; @@ -73,17 +73,17 @@ void updateErrorMessage() { QualityNotificationMessage message = QualityNotificationMessage.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).affectedParts(List.of(new QualityNotificationAffectedPart("123"))).build(); QualityNotification qualityNotification = QualityNotification.builder().notificationStatus(QualityNotificationStatus.ACKNOWLEDGED).assetIds(List.of("123")).notificationId(new QualityNotificationId(123L)).bpn(BPN.of("ABC")).notifications(List.of(message)).build(); AssetAsBuiltEntity assetAsBuiltEntity = AssetAsBuiltEntity.builder().id("123").build(); - AlertEntity entity = AlertEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); - AlertNotificationEntity notificationEntity = AlertNotificationEntity.from(entity, message, List.of(assetAsBuiltEntity)); + NotificationEntity entity = NotificationEntity.builder().assets(List.of(assetAsBuiltEntity)).build(); + NotificationMessageEntity notificationEntity = NotificationMessageEntity.from(entity, message, List.of(assetAsBuiltEntity)); when(assetsRepository.findByIdIn(any())).thenReturn(List.of(assetAsBuiltEntity)); - when(jpaAlertRepository.findById(any())).thenReturn(Optional.of(entity)); - when(notificationRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); + when(jpaNotificationRepository.findById(any())).thenReturn(Optional.of(entity)); + when(jpaNotificationMessageRepository.findById(notificationEntity.getId())).thenReturn(Optional.of(notificationEntity)); when(clock.instant()).thenReturn(Instant.now()); when(clock.getZone()).thenReturn(ZoneId.systemDefault()); // When - alertRepository.updateErrorMessage(qualityNotification); + notificationRepository.updateErrorMessage(qualityNotification); // Then - verify(notificationRepository, times(1)).save(any()); + verify(jpaNotificationMessageRepository, times(1)).save(any()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java index 5563fd2e3b..1a61f10b1c 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/investigation/rest/validation/UpdateQualityNotificationValidatorTest.java @@ -21,8 +21,8 @@ package org.eclipse.tractusx.traceability.qualitynotification.investigation.rest.validation; -import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidationException; -import org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation.UpdateQualityNotificationValidationException; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.validation.UpdateQualityNotificationValidator; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java index 11b31a5e59..14056aac97 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java @@ -38,6 +38,11 @@ @NoArgsConstructor @AllArgsConstructor public class StartQualityNotificationRequest { + + @Size(min = 1, max = 255, message = "Specify at least 1 and at most 50 assetIds") + @Schema(example = "title", minLength = 1, maxLength = 255) + private String title; + @Size(min = 1, max = 50, message = "Specify at least 1 and at most 50 assetIds") @Schema(example = "[\"urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978\"]", minLength = 1, maxLength = 100) private List partIds; diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java index a1eae13f83..2d34e7bba2 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationResponse.java @@ -41,6 +41,10 @@ public class QualityNotificationResponse { @Size(max = 255) private Long id; + @Schema(example = "Title", maxLength = 255) + @Size(max = 255) + private String title; + @Schema(example = "CREATED", maxLength = 255) @Size(max = 255) private QualityNotificationStatusResponse status; From 4e4400470af27fdf138fc62da60f57eeada37db0 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 08:14:26 +0100 Subject: [PATCH 06/13] chore(tx-backend) 706 update documentation --- .../send-notification-policy-verification.puml | 2 +- .../notifications/quality-investigation-receive.adoc | 6 +++--- .../notifications/quality-investigation-send.adoc | 4 ++-- .../arc42/runtime-view/quality-investigation-receive.puml | 2 +- .../arc42/runtime-view/quality-investigation-send.puml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/concept/#568-policy-management/send-notification-policy-verification.puml b/docs/concept/#568-policy-management/send-notification-policy-verification.puml index e5052ae015..67dd75a01a 100644 --- a/docs/concept/#568-policy-management/send-notification-policy-verification.puml +++ b/docs/concept/#568-policy-management/send-notification-policy-verification.puml @@ -1,7 +1,7 @@ @startuml title - ==Send Quality Investigation + ==Send Quality Notification end title autonumber "[00]" diff --git a/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-receive.adoc b/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-receive.adoc index 151f408352..5c0bb02a2c 100644 --- a/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-receive.adoc +++ b/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-receive.adoc @@ -1,6 +1,6 @@ -= Receive Quality Investigation += Receive Quality Notification -This sequence diagram describes the process of receiving a quality investigation from another Traceability partner. +This sequence diagram describes the process of receiving a quality notification from another Traceability partner. [plantuml, target=business-context_quality-investigation, format=svg] .... @@ -8,7 +8,7 @@ include::../../../../uml-diagrams/arc42/runtime-view/quality-investigation-recei .... == Overview -As for the sending of a quality investigation also for receiving of a notification EDC is used to push data from a sender to a receiver. +As for the sending of a quality notification also for receiving of a notification EDC is used to push data from a sender to a receiver. To enable receiving a notification by a partner you need to * Create notification endpoint for qualitynotifications/receive diff --git a/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-send.adoc b/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-send.adoc index 21b83ed9b1..fbeec29fb0 100644 --- a/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-send.adoc +++ b/docs/src/docs/arc42/runtime-view/notifications/quality-investigation-send.adoc @@ -1,6 +1,6 @@ -= Send Quality Investigation += Send Quality Notification -This sequence diagram describes the process of sending a quality investigation between Traceability applications. +This sequence diagram describes the process of sending a quality notification between Traceability applications. [plantuml, target=business-context_quality-investigation_send, format=svg] .... diff --git a/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-receive.puml b/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-receive.puml index 5e1e4ae7d4..f599796e5c 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-receive.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-receive.puml @@ -1,7 +1,7 @@ @startuml title - ==Receive Quality Investigation + ==Receive Quality Notification end title autonumber "[00]" diff --git a/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-send.puml b/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-send.puml index e0a4e3e16a..bb426634ba 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-send.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/quality-investigation-send.puml @@ -1,7 +1,7 @@ @startuml title - ==Send Quality Investigation + ==Send Quality Notification end title autonumber "[00]" From e95788b3ca56bca9ff0294d935341fe7d10eb915 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 08:18:42 +0100 Subject: [PATCH 07/13] chore(tx-backend) 706 InvestigationsEDCFacade.java renamed to NotificationsEDCFacade.java --- .../base/service/EdcNotificationServiceImpl.java | 2 +- ...onsEDCFacade.java => NotificationsEDCFacade.java} | 2 +- ...cadeTest.java => NotificationsEDCFacadeTest.java} | 12 ++++++------ .../service/EdcNotificationServiceImplTest.java | 4 ++-- tx-coverage/pom.xml | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) rename tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/{InvestigationsEDCFacade.java => NotificationsEDCFacade.java} (99%) rename tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/{InvestigationsEDCFacadeTest.java => NotificationsEDCFacadeTest.java} (91%) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java index 8b9484b4e8..ff6005582a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/EdcNotificationServiceImpl.java @@ -54,7 +54,7 @@ @Profile(NOT_INTEGRATION_TESTS) public class EdcNotificationServiceImpl implements EdcNotificationService { - private final InvestigationsEDCFacade edcFacade; + private final NotificationsEDCFacade edcFacade; private final DiscoveryService discoveryService; private final NotificationRepository notificationRepository; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationsEDCFacade.java similarity index 99% rename from tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java rename to tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationsEDCFacade.java index 735a066c5d..4d4016764f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/InvestigationsEDCFacade.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationsEDCFacade.java @@ -68,7 +68,7 @@ @Component @RequiredArgsConstructor @Transactional(dontRollbackOn = {ContractNegotiationException.class, NoCatalogItemException.class, SendNotificationException.class, NoEndpointDataReferenceException.class}) -public class InvestigationsEDCFacade { +public class NotificationsEDCFacade { public static final String DEFAULT_PROTOCOL = "dataspace-protocol-http"; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/InvestigationsEDCFacadeTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java similarity index 91% rename from tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/InvestigationsEDCFacadeTest.java rename to tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java index 363051b8d4..68740d7144 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/InvestigationsEDCFacadeTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java @@ -33,7 +33,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.InvestigationsEDCFacade; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationsEDCFacade; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -48,7 +48,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class InvestigationsEDCFacadeTest { +class NotificationsEDCFacadeTest { @Mock ObjectMapper objectMapper; @Mock @@ -64,7 +64,7 @@ class InvestigationsEDCFacadeTest { @Mock EndpointDataReference endpointDataReference; @InjectMocks - InvestigationsEDCFacade investigationsEDCFacade; + NotificationsEDCFacade notificationsEDCFacade; @Test void givenCorrectInvestigationMessageButSendRequestThrowsException_whenStartEdcTransfer_thenThrowSendNotificationException() throws Exception { @@ -94,7 +94,7 @@ void givenCorrectInvestigationMessageButSendRequestThrowsException_whenStartEdcT // when/then - assertThrows(SendNotificationException.class, () -> investigationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); + assertThrows(SendNotificationException.class, () -> notificationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); } @Test @@ -116,7 +116,7 @@ void givenCorrectInvestigationMessageButNegotiateContractAgreementHasNoCatalogIt .thenReturn(null); // when/then - assertThrows(ContractNegotiationException.class, () -> investigationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); + assertThrows(ContractNegotiationException.class, () -> notificationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); } @Test @@ -133,6 +133,6 @@ void givenCorrectInvestigationMessageButCatalogItem_whenStartEdcTransfer_thenThr when(edcCatalogFacade.fetchCatalogItems(any())).thenReturn(List.of()); // when/then - assertThrows(NoCatalogItemException.class, () -> investigationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); + assertThrows(NoCatalogItemException.class, () -> notificationsEDCFacade.startEdcTransfer(notificationMessage, receiverEdcUrl, senderEdcUrl)); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java index 89fd74a9e6..1fc7ef59c7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/EdcNotificationServiceImplTest.java @@ -29,7 +29,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.EdcNotificationServiceImpl; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.InvestigationsEDCFacade; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationsEDCFacade; import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -53,7 +53,7 @@ class EdcNotificationServiceImplTest { private EdcNotificationServiceImpl notificationsService; @Mock - private InvestigationsEDCFacade edcFacade; + private NotificationsEDCFacade edcFacade; @Mock private DiscoveryService discoveryService; diff --git a/tx-coverage/pom.xml b/tx-coverage/pom.xml index 6dcc2fae43..f145f7ac77 100644 --- a/tx-coverage/pom.xml +++ b/tx-coverage/pom.xml @@ -60,7 +60,7 @@ SPDX-License-Identifier: Apache-2.0 tx-backend/src/main/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/HttpCallService.java - tx-backend/src/main/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/InvestigationsEDCFacade.java + tx-backend/src/main/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacade.java tx-backend/src/main/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/EdcService.java From a4a054c25a04140fd0147309a8cc0df6287b79f7 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Sun, 24 Mar 2024 10:09:30 +0100 Subject: [PATCH 08/13] chore(tx-backend) 706 sonar findings --- .../openapi/traceability-foss-backend.json | 1492 ++++++++--------- .../rest/NotificationController.java | 18 +- .../AbstractQualityNotificationService.java | 10 +- .../service/NotificationPublisherService.java | 25 +- .../repository/NotificationRepository.java | 2 - .../repository/JpaNotificationRepository.java | 6 +- .../NotificationRepositoryImpl.java | 5 +- .../mapper/QualityNotificationMapperTest.java | 2 +- .../NotificationPublisherServiceTest.java | 76 +- 9 files changed, 823 insertions(+), 813 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 912864c786..4a95c2ea06 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -31,23 +31,18 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "200" : { - "description" : "Returns the paged result found", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -56,8 +51,8 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -66,8 +61,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -76,8 +71,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -86,18 +81,23 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -106,8 +106,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -148,18 +148,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -183,8 +173,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -193,8 +183,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -203,8 +193,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -213,8 +203,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -223,8 +213,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -265,18 +265,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -300,8 +290,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -310,8 +300,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -320,8 +310,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -330,8 +320,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -340,8 +330,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -379,8 +379,8 @@ } ], "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -389,18 +389,18 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Returns submodel payload", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "type" : "string" } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -409,8 +409,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -419,8 +419,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -429,18 +429,18 @@ } } }, - "200" : { - "description" : "Returns submodel payload", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "type" : "string" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -449,8 +449,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -496,11 +496,8 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -509,8 +506,11 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Ok." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -519,8 +519,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -529,11 +529,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -542,8 +539,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -552,8 +549,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No Content." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -562,8 +562,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -783,8 +783,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -793,8 +793,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -803,8 +803,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -813,18 +813,18 @@ } } }, - "201" : { - "description" : "Created.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -833,18 +833,18 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "201" : { + "description" : "Created.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/CreateNotificationContractResponse" } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -853,8 +853,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -892,17 +892,30 @@ "required" : true }, "responses" : { - "200" : { - "description" : "Ok.", + "415" : { + "description" : "Unsupported media type.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "PageResults", - "items" : { - "$ref" : "#/components/schemas/PageResultContractResponse" + "type" : "string", + "example" : { + "message" : "Unsupported media type." + } + } + } + } + }, + "200" : { + "description" : "Ok.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "description" : "PageResults", + "items" : { + "$ref" : "#/components/schemas/PageResultContractResponse" } } } @@ -921,40 +934,40 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Too many requests." + "message" : "Bad request." } } } } }, - "415" : { - "description" : "Unsupported media type.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Unsupported media type." + "message" : "Forbidden." } } } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Bad request." + "message" : "Too many requests." } } } @@ -985,19 +998,6 @@ } } } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Forbidden." - } - } - } - } } }, "security" : [ @@ -1040,8 +1040,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1050,8 +1050,14 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1060,14 +1066,8 @@ } } }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1076,8 +1076,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1086,8 +1086,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1099,8 +1099,8 @@ "204" : { "description" : "No Content." }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1109,8 +1109,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1156,18 +1156,18 @@ } }, "responses" : { - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportResponse" } } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1176,8 +1176,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1186,18 +1186,18 @@ } } }, - "200" : { - "description" : "OK.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1206,8 +1206,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1219,8 +1219,8 @@ "204" : { "description" : "No Content." }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1229,8 +1229,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1268,8 +1268,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1278,8 +1278,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1288,8 +1288,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1298,11 +1298,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1311,8 +1308,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1321,8 +1318,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1331,8 +1331,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1370,18 +1370,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1390,8 +1380,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1400,8 +1390,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1410,8 +1400,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1612,8 +1602,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1622,8 +1612,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1661,8 +1661,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1671,8 +1671,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1681,8 +1681,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1691,11 +1691,8 @@ } } }, - "201" : { - "description" : "Created." - }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1704,8 +1701,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1714,8 +1711,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "201" : { + "description" : "Created." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1724,8 +1724,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1763,18 +1763,8 @@ "required" : true }, "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1975,8 +1965,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1985,8 +1975,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1995,8 +1985,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2005,8 +1995,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2015,8 +2005,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2054,36 +2054,6 @@ } ], "responses" : { - "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" : { @@ -2094,26 +2064,6 @@ } } }, - "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" - } - } - } - }, "200" : { "description" : "Returns the assets found", "content" : { @@ -2301,6 +2251,16 @@ } } }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "403" : { "description" : "Forbidden.", "content" : { @@ -2310,6 +2270,46 @@ } } } + }, + "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" + } + } + } + }, + "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" + } + } + } } }, "security" : [ @@ -2348,6 +2348,66 @@ "required" : true }, "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -2535,16 +2595,6 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -2554,56 +2604,6 @@ } } } - }, - "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" - } - } - } - }, - "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" - } - } - } } }, "security" : [ @@ -2634,8 +2634,8 @@ } ], "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2644,8 +2644,38 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", + "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" + } + } + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2841,38 +2871,8 @@ } } }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2881,8 +2881,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2928,6 +2928,46 @@ "required" : true }, "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3115,26 +3155,6 @@ } } }, - "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" : { @@ -3145,28 +3165,8 @@ } } }, - "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" - } - } - } - }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3175,8 +3175,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3204,8 +3204,8 @@ "description" : "The endpoint Triggers reload of shell descriptors.", "operationId" : "reload", "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3214,8 +3214,8 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3224,11 +3224,8 @@ } } }, - "202" : { - "description" : "Created registry reload job." - }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3237,8 +3234,11 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "202" : { + "description" : "Created registry reload job." + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3247,8 +3247,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3257,8 +3257,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3267,8 +3267,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3296,18 +3296,18 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "Returns the policies", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3316,18 +3316,18 @@ } } }, - "200" : { - "description" : "Returns the policies", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3336,8 +3336,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3346,8 +3346,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3356,8 +3356,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3366,8 +3366,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3493,28 +3493,28 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "200" : { - "description" : "Returns dashboard data", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3523,8 +3523,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3533,8 +3533,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3543,8 +3543,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3553,8 +3553,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3563,8 +3563,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3603,28 +3603,28 @@ } ], "responses" : { - "200" : { - "description" : "OK.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3633,8 +3633,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3643,8 +3643,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3653,8 +3653,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3666,8 +3666,8 @@ "204" : { "description" : "No Content." }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3676,8 +3676,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3723,26 +3723,6 @@ } ], "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3935,8 +3915,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3945,8 +3925,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3955,8 +3935,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3975,8 +3955,28 @@ } } }, - "403" : { - "description" : "Forbidden.", + "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" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4046,23 +4046,18 @@ } ], "responses" : { - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4071,8 +4066,8 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4081,8 +4076,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4091,8 +4086,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4101,18 +4096,23 @@ } } }, - "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", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4121,8 +4121,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4160,8 +4160,8 @@ } ], "responses" : { - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4170,8 +4170,38 @@ } } }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", + "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" + } + } + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4361,44 +4391,14 @@ "type" : "string", "example" : "TODO" } - } - } - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + } + } } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4407,8 +4407,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4454,18 +4454,8 @@ } ], "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4666,8 +4656,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4676,8 +4666,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4686,8 +4676,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4696,8 +4686,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4706,8 +4696,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4777,23 +4777,18 @@ } ], "responses" : { - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4802,8 +4797,8 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4812,8 +4807,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4822,8 +4817,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4832,18 +4827,23 @@ } } }, - "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", + "items" : { + "type" : "string" + } } } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -4852,8 +4852,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4881,18 +4881,8 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4901,8 +4891,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4911,8 +4901,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4921,8 +4911,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4931,8 +4921,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4956,8 +4946,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4995,6 +4995,16 @@ } ], "responses" : { + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -5182,18 +5192,8 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5202,8 +5202,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5212,8 +5212,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5222,8 +5222,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5232,8 +5232,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5242,8 +5242,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5271,11 +5271,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "200" : { - "description" : "Ok." - }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5284,8 +5281,11 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Ok." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5294,8 +5294,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5304,11 +5304,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5317,8 +5314,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5327,8 +5324,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "No Content." + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5337,8 +5337,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5379,8 +5379,8 @@ "200" : { "description" : "Okay" }, - "500" : { - "description" : "Internal server error.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5392,8 +5392,8 @@ "204" : { "description" : "Deleted." }, - "404" : { - "description" : "Not found.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5402,8 +5402,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5412,8 +5412,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5422,8 +5422,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5432,8 +5432,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5442,8 +5442,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java index aeed5bc3b7..5e367d8464 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java @@ -28,9 +28,9 @@ import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.request.OwnPageable; import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; +import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.NotificationResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.QualityNotificationFieldMapper; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.service.QualityNotificationService; -import org.eclipse.tractusx.traceability.qualitynotification.application.notification.mapper.NotificationResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.springframework.beans.factory.annotation.Qualifier; @@ -65,6 +65,7 @@ @Slf4j public class NotificationController { + private static final String RECEIVED_API_CALL_LOG = "Received API call on /notifications"; private final QualityNotificationService notificationService; private final BaseRequestFieldMapper fieldMapper; @@ -81,13 +82,14 @@ public NotificationController( @ResponseStatus(HttpStatus.CREATED) public QualityNotificationIdResponse alertAssets(@RequestBody @Valid StartQualityNotificationRequest request) { StartQualityNotificationRequest cleanStartQualityNotificationRequest = sanitize(request); - log.info("Received API call on /notifications" + " with params: {}", cleanStartQualityNotificationRequest); + log.info(RECEIVED_API_CALL_LOG + " with params: {}", cleanStartQualityNotificationRequest); return new QualityNotificationIdResponse(notificationService.start(from(cleanStartQualityNotificationRequest)).value()); } @PostMapping("/filter") public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { - log.info("Received API call on /notifications/filter"); + log.info(RECEIVED_API_CALL_LOG + "/filter"); + return NotificationResponseMapper.fromAsPageResult( notificationService.getNotifications( OwnPageable.toPageable(pageableFilterRequest.getOwnPageable(), fieldMapper), @@ -96,7 +98,7 @@ public PageResult getAlerts(@Valid @RequestBody Pag @GetMapping("/{notificationId}") public QualityNotificationResponse getAlert(@PathVariable("notificationId") Long notificationId) { - log.info("Received API call on /notifications/" + "/{}", notificationId); + log.info(RECEIVED_API_CALL_LOG + "/{}", notificationId); return NotificationResponseMapper.from(notificationService.find(notificationId)); } @@ -104,7 +106,7 @@ public QualityNotificationResponse getAlert(@PathVariable("notificationId") Long @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @ResponseStatus(HttpStatus.NO_CONTENT) public void approveAlert(@PathVariable("notificationId") Long notificationId) { - log.info("Received API call on /notifications/" + "/{}/approve", notificationId); + log.info(RECEIVED_API_CALL_LOG + "/{}/approve", notificationId); notificationService.approve(notificationId); } @@ -112,7 +114,7 @@ public void approveAlert(@PathVariable("notificationId") Long notificationId) { @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @ResponseStatus(HttpStatus.NO_CONTENT) public void cancelAlert(@PathVariable("notificationId") Long notificationId) { - log.info("Received API call on /notifications/" + "/{}/cancel", notificationId); + log.info(RECEIVED_API_CALL_LOG + "/{}/cancel", notificationId); notificationService.cancel(notificationId); } @@ -123,7 +125,7 @@ public void closeAlert( @PathVariable("notificationId") @ApiParam Long notificationId, @Valid @RequestBody CloseQualityNotificationRequest closeAlertRequest) { CloseQualityNotificationRequest cleanCloseAlertRequest = sanitize(closeAlertRequest); - log.info("Received API call on /notifications/" + "/{}/close with params {}", notificationId, cleanCloseAlertRequest); + log.info(RECEIVED_API_CALL_LOG + "/{}/close with params {}", notificationId, cleanCloseAlertRequest); notificationService.update(notificationId, QualityNotificationStatus.from(QualityNotificationStatusRequest.CLOSED), cleanCloseAlertRequest.getReason()); } @@ -135,7 +137,7 @@ public void updateAlert( @Valid @RequestBody UpdateQualityNotificationRequest updateAlertRequest) { UpdateQualityNotificationRequest cleanUpdateAlertRequest = sanitize(updateAlertRequest); validate(cleanUpdateAlertRequest); - log.info("Received API call on /notifications/" + "/{}/update with params {}", notificationId, cleanUpdateAlertRequest); + log.info(RECEIVED_API_CALL_LOG + "/{}/update with params {}", notificationId, cleanUpdateAlertRequest); notificationService.update(notificationId, QualityNotificationStatus.from(cleanUpdateAlertRequest.getStatus()), cleanUpdateAlertRequest.getReason()); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 8208ad5dc1..675ec6ed56 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -60,15 +60,7 @@ public PageResult getNotifications(Pageable pageable, Searc @Override public QualityNotificationId start(StartQualityNotification startQualityNotification) { - QualityNotification notification = notificationPublisherService.startQualityNotification( - startQualityNotification.getTitle(), - startQualityNotification.getPartIds(), - startQualityNotification.getDescription(), - startQualityNotification.getTargetDate(), - startQualityNotification.getSeverity(), - startQualityNotification.getType(), - startQualityNotification.getReceiverBpn(), - startQualityNotification.isAsBuilt()); + QualityNotification notification = notificationPublisherService.startQualityNotification(startQualityNotification); QualityNotificationId createdAlertId = getQualityNotificationRepository().saveQualityNotificationEntity(notification); log.info("Start Quality Notification {}", notification); return createdAlertId; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java index a3761a7535..0b8d863ea5 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/NotificationPublisherService.java @@ -30,16 +30,14 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.exception.QualityNotificationIllegalUpdate; import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification; import org.springframework.stereotype.Service; import java.time.Clock; -import java.time.Instant; import java.util.List; import java.util.Map; import java.util.Objects; @@ -59,18 +57,27 @@ public class NotificationPublisherService { private final Clock clock; - public QualityNotification startQualityNotification(String title, List assetIds, String description, Instant targetDate, QualityNotificationSeverity severity, QualityNotificationType type, String receiverBpn, boolean isAsBuilt) { + public QualityNotification startQualityNotification(StartQualityNotification startQualityNotification) { BPN applicationBPN = traceabilityProperties.getBpn(); - QualityNotification notification = QualityNotification.startNotification(title, clock.instant(), applicationBPN, description, type); - if (isAsBuilt) { - Map> assetsAsBuiltBPNMap = assetAsBuiltRepository.getAssetsById(assetIds).stream().collect(groupingBy(AssetBase::getManufacturerId)); + QualityNotification notification = QualityNotification.startNotification(startQualityNotification.getTitle(), clock.instant(), applicationBPN, startQualityNotification.getDescription(), startQualityNotification.getType()); + if (startQualityNotification.isAsBuilt()) { + Map> assetsAsBuiltBPNMap = assetAsBuiltRepository.getAssetsById(startQualityNotification.getPartIds()).stream().collect(groupingBy(AssetBase::getManufacturerId)); assetsAsBuiltBPNMap .entrySet() .stream() .map(it -> { String creator = getManufacturerNameByBpn(traceabilityProperties.getBpn().value()); - String sendToName = getManufacturerNameByBpn(receiverBpn); - return QualityNotificationMessage.create(applicationBPN, receiverBpn, description, targetDate, severity, type, it, creator, sendToName); + String sendToName = getManufacturerNameByBpn(startQualityNotification.getReceiverBpn()); + return QualityNotificationMessage.create( + applicationBPN, + startQualityNotification.getReceiverBpn(), + startQualityNotification.getDescription(), + startQualityNotification.getTargetDate(), + startQualityNotification.getSeverity(), + startQualityNotification.getType(), + it, + creator, + sendToName); }) .forEach(notification::addNotification); return notification; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java index 04b089a3a2..c7728ebb53 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/notification/repository/NotificationRepository.java @@ -19,7 +19,5 @@ package org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository; -import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.QualityNotificationRepository; - public interface NotificationRepository extends QualityNotificationRepository { } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java index e7c0db3938..9b15862aba 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/JpaNotificationRepository.java @@ -19,10 +19,10 @@ package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.repository; +import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationStatusBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationTypeEntity; -import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.notification.model.NotificationEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; @@ -39,11 +39,9 @@ public interface JpaNotificationRepository extends JpaRepository findByNotificationsEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); + Optional findByNotificationMessageEdcNotificationId(@Param("edcNotificationId") String edcNotificationId); - // TODO findByNotificationMessageId @Query("SELECT notification FROM NotificationEntity notification JOIN notification.messages notificationMessage WHERE notificationMessage.id = :id") Optional findByNotificationMessageId(@Param("id") String id); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java index 52c7dac234..41f2c4bfa2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/notification/repository/NotificationRepositoryImpl.java @@ -29,6 +29,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.repository.BaseSpecification; import org.eclipse.tractusx.traceability.common.repository.CriteriaUtility; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; @@ -79,7 +80,7 @@ public Optional findOptionalQualityNotificationById(Quality @Override public Optional findByEdcNotificationId(String edcNotificationId) { - return jpaNotificationRepository.findByNotificationsEdcNotificationId(edcNotificationId).map(NotificationEntity::toDomain); + return jpaNotificationRepository.findByNotificationMessageEdcNotificationId(edcNotificationId).map(NotificationEntity::toDomain); } @Override @@ -136,7 +137,7 @@ public PageResult getNotifications(Pageable pageable, Searc .stream() .map(NotificationSpecification::new) .toList(); - Specification specification = NotificationSpecification.toSpecification(notificationSpecifications); + Specification specification = BaseSpecification.toSpecification(notificationSpecifications); return new PageResult<>(jpaNotificationRepository.findAll(specification, pageable), NotificationEntity::toDomain); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java index ea625aaafe..6f884dc409 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/common/mapper/QualityNotificationMapperTest.java @@ -73,7 +73,7 @@ void testToReceiverInvestigation() { assertEquals(description, result.getDescription()); assertEquals(List.of("123"), result.getAssetIds()); assertEquals(List.of(notification), result.getNotifications()); - assertEquals(result.getNotificationType(), QualityNotificationType.INVESTIGATION); + assertEquals(QualityNotificationType.INVESTIGATION, result.getNotificationType()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java index 5eb7e8b636..9a6a3ea9f9 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/service/NotificationPublisherServiceTest.java @@ -36,6 +36,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.EdcNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.service.NotificationPublisherService; import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.exception.NotificationNotSupportedException; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.repository.NotificationRepository; import org.eclipse.tractusx.traceability.testdata.AssetTestDataFactory; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; @@ -88,20 +89,24 @@ void testStartInvestigationSuccessful() { // Given String title = "title"; String description = "Test investigation"; - when(assetRepository.getAssetsById(Arrays.asList("asset-1", "asset-2"))).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); + List assets = Arrays.asList("asset-1", "asset-2"); + Instant targetDate = Instant.parse("2022-03-01T12:00:00Z"); + when(assetRepository.getAssetsById(assets)).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); when(traceabilityProperties.getBpn()).thenReturn(BPN.of("bpn-123")); String receiverBpn = "someReceiverBpn"; + StartQualityNotification startNotification = StartQualityNotification.builder() + .title(title) + .partIds(assets) + .description(description) + .targetDate(targetDate) + .severity(QualityNotificationSeverity.MINOR) + .type(QualityNotificationType.INVESTIGATION) + .receiverBpn(receiverBpn) + .isAsBuilt(true) + .build(); // When - QualityNotification result = notificationPublisherService.startQualityNotification( - title, - Arrays.asList("asset-1", "asset-2"), - description, - Instant.parse("2022-03-01T12:00:00Z"), - QualityNotificationSeverity.MINOR, - QualityNotificationType.INVESTIGATION, - receiverBpn, - true); + QualityNotification result = notificationPublisherService.startQualityNotification(startNotification); // Then assertThat(result.getTitle()).isEqualTo(title); @@ -119,17 +124,21 @@ void testThrowNotificationNotSupportedException() { String title = "Title"; String description = "Test investigation"; String receiverBpn = "someReceiverBpn"; + Instant targetDate = Instant.parse("2022-03-01T12:00:00Z"); + List assets = Arrays.asList("asset-1", "asset-2"); + StartQualityNotification startNotification = StartQualityNotification.builder() + .title(title) + .partIds(assets) + .description(description) + .targetDate(targetDate) + .severity(QualityNotificationSeverity.MINOR) + .type(QualityNotificationType.INVESTIGATION) + .receiverBpn(receiverBpn) + .isAsBuilt(false) + .build(); // Then - assertThrows(NotificationNotSupportedException.class, () -> notificationPublisherService.startQualityNotification( - title, - Arrays.asList("asset-1", "asset-2"), - description, - Instant.parse("2022-03-01T12:00:00Z"), - QualityNotificationSeverity.MINOR, - QualityNotificationType.INVESTIGATION, - receiverBpn, - false)); + assertThrows(NotificationNotSupportedException.class, () -> notificationPublisherService.startQualityNotification(startNotification)); } @Test @@ -137,20 +146,23 @@ void testStartAlertSuccessful() { // Given String title = "Title"; String description = "Test investigation"; - String receiverBPN = "BPN00001"; + String receiverBpn = "BPN00001"; + Instant targetDate = Instant.parse("2022-03-01T12:00:00Z"); + List assets = Arrays.asList("asset-1", "asset-2"); when(traceabilityProperties.getBpn()).thenReturn(BPN.of("bpn-123")); - when(assetRepository.getAssetsById(Arrays.asList("asset-1", "asset-2"))).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); - + when(assetRepository.getAssetsById(assets)).thenReturn(List.of(AssetTestDataFactory.createAssetTestData())); + StartQualityNotification startNotification = StartQualityNotification.builder() + .title(title) + .partIds(assets) + .description(description) + .targetDate(targetDate) + .severity(QualityNotificationSeverity.MINOR) + .type(QualityNotificationType.INVESTIGATION) + .receiverBpn(receiverBpn) + .isAsBuilt(true) + .build(); // When - QualityNotification result = notificationPublisherService.startQualityNotification( - title, - Arrays.asList("asset-1", "asset-2"), - description, - Instant.parse("2022-03-01T12:00:00Z"), - QualityNotificationSeverity.MINOR, - QualityNotificationType.ALERT, - receiverBPN, - true); + QualityNotification result = notificationPublisherService.startQualityNotification(startNotification); // Then assertThat(result.getNotificationStatus()).isEqualTo(QualityNotificationStatus.CREATED); @@ -160,7 +172,7 @@ void testStartAlertSuccessful() { .containsExactly(QualityNotificationSeverity.MINOR); assertThat(result.getNotifications()).hasSize(1) .first() - .hasFieldOrPropertyWithValue("sendTo", receiverBPN); + .hasFieldOrPropertyWithValue("sendTo", receiverBpn); verify(assetRepository).getAssetsById(Arrays.asList("asset-1", "asset-2")); } From 289327aa1883da07d5c6d5880b47abb27ac259b9 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Mon, 25 Mar 2024 11:02:51 +0100 Subject: [PATCH 09/13] chore(tx-backend) 706 return 400 on missing notification type in StartQualityNotificationRequest --- .../alert/PublisherAlertsControllerIT.java | 32 ++++++++++++++++++- .../StartQualityNotificationRequest.java | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java index d202ca39e0..7e80ef0f85 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/PublisherAlertsControllerIT.java @@ -33,12 +33,12 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; -import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; +import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.service.NotificationReceiverService; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotification; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.edc.model.EDCNotificationFactory; import org.hamcrest.Matchers; @@ -560,4 +560,34 @@ void shouldBeCreatedBySender() throws JsonProcessingException, JoseException { .body("pageSize", Matchers.is(10)) .body("content", Matchers.hasSize(1)); } + + @Test + void shouldReturn404WhenNoNotificationTypeSpecified() throws JsonProcessingException, JoseException { + // given + List partIds = List.of( + "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE + "urn:uuid:0ce83951-bc18-4e8f-892d-48bad4eb67ef" // BPN: BPNL00000003AXS3 + ); + String description = "at least 15 characters long investigation description"; + + assetsSupport.defaultAssetsStored(); + + val startAlertRequest = StartQualityNotificationRequest.builder() + .partIds(partIds) + .description(description) + .severity(QualityNotificationSeverityRequest.MINOR) + .receiverBpn("BPN") + .isAsBuilt(true) + .build(); + + // when + given() + .contentType(ContentType.JSON) + .body(objectMapper.writeValueAsString(startAlertRequest)) + .header(oAuth2Support.jwtAuthorization(SUPERVISOR)) + .when() + .post("/api/notifications") + .then() + .statusCode(400); + } } diff --git a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java index 14056aac97..898af3337b 100644 --- a/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java +++ b/tx-models/src/main/java/qualitynotification/base/request/StartQualityNotificationRequest.java @@ -65,6 +65,7 @@ public class StartQualityNotificationRequest { private String receiverBpn; @Schema(example = "ALERT") + @NotNull private QualityNotificationTypeRequest type; } From 977207d79564d6412e5355b272b9c10d4f21f334 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Mon, 25 Mar 2024 11:03:07 +0100 Subject: [PATCH 10/13] chore(tx-backend) 706 return 400 on missing notification type in StartQualityNotificationRequest --- .../openapi/traceability-foss-backend.json | 1531 +++++++++-------- 1 file changed, 766 insertions(+), 765 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 4a95c2ea06..32fab502ff 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -31,8 +31,8 @@ "description" : "The endpoint returns a result of BPN EDC URL mappings.", "operationId" : "getBpnEdcs", "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -41,8 +41,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -61,18 +61,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns the paged result found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -81,23 +86,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -106,8 +106,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -148,8 +148,18 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -173,16 +183,6 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -193,8 +193,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -203,8 +203,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -213,8 +213,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -223,8 +223,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -265,8 +265,18 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -290,16 +300,6 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -310,8 +310,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -320,8 +320,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -330,8 +330,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -340,8 +340,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -379,8 +379,8 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -389,22 +389,22 @@ } } }, - "200" : { - "description" : "Returns submodel payload", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "type" : "string" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "200" : { + "description" : "Returns submodel payload", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "type" : "string" } } } @@ -419,8 +419,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -429,8 +429,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -439,8 +439,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -449,8 +449,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -496,8 +496,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -506,11 +506,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -519,6 +516,9 @@ } } }, + "200" : { + "description" : "Ok." + }, "403" : { "description" : "Forbidden.", "content" : { @@ -529,8 +529,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -539,8 +539,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -552,8 +552,8 @@ "204" : { "description" : "No Content." }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -562,8 +562,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -783,8 +783,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -793,8 +793,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -813,8 +813,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -823,8 +823,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -843,8 +843,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -853,8 +853,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -892,14 +892,27 @@ "required" : true }, "responses" : { - "415" : { - "description" : "Unsupported media type.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Unsupported media type." + "message" : "Too many requests." + } + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "type" : "string", + "example" : { + "message" : "Internal server error." } } } @@ -921,79 +934,66 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Not found." + "message" : "Forbidden." } } } } }, - "400" : { - "description" : "Bad request.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Bad request." + "message" : "Authorization failed." } } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Forbidden." + "message" : "Unsupported media type." } } } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Too many requests." + "message" : "Bad request." } } } } }, - "500" : { - "description" : "Internal server error.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { "type" : "string", "example" : { - "message" : "Internal server error." - } - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Authorization failed." + "message" : "Not found." } } } @@ -1040,8 +1040,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1050,14 +1050,8 @@ } } }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1066,6 +1060,9 @@ } } }, + "204" : { + "description" : "No Content." + }, "403" : { "description" : "Forbidden.", "content" : { @@ -1076,8 +1073,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1086,8 +1083,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1096,11 +1093,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1109,8 +1103,14 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1156,18 +1156,18 @@ } }, "responses" : { - "200" : { - "description" : "OK.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1176,12 +1176,15 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content." + }, + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportResponse" } } } @@ -1196,8 +1199,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1206,8 +1209,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1216,11 +1219,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1229,8 +1229,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1268,8 +1268,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1278,8 +1278,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1298,8 +1298,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1308,8 +1308,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1321,8 +1321,8 @@ "201" : { "description" : "Created." }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1331,8 +1331,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1370,8 +1370,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1380,8 +1380,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1400,8 +1400,18 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1612,18 +1622,8 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1661,8 +1661,8 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1671,8 +1671,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1691,8 +1691,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1701,8 +1701,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1714,8 +1714,8 @@ "201" : { "description" : "Created." }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1724,8 +1724,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1763,8 +1763,18 @@ "required" : true }, "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1965,16 +1975,6 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "403" : { "description" : "Forbidden.", "content" : { @@ -1985,8 +1985,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -1995,8 +1995,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2005,8 +2005,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2015,8 +2015,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2054,16 +2054,6 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the assets found", "content" : { @@ -2251,8 +2241,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2261,8 +2251,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2271,8 +2261,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2281,8 +2271,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -2301,8 +2291,8 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2310,14 +2300,24 @@ } } } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } ] }, "patch" : { @@ -2348,28 +2348,8 @@ "required" : true }, "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2388,26 +2368,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -2595,8 +2555,48 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2634,28 +2634,8 @@ } ], "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -2674,16 +2654,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the assets found", "content" : { @@ -2871,6 +2841,26 @@ } } }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "500" : { "description" : "Internal server error.", "content" : { @@ -2881,8 +2871,18 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2928,46 +2928,6 @@ "required" : true }, "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3155,8 +3115,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3165,8 +3125,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3175,8 +3135,8 @@ } } }, - "404" : { - "description" : "Not found.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3184,28 +3144,9 @@ } } } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/registry/reload" : { - "get" : { - "tags" : [ - "Registry" - ], - "summary" : "Triggers reload of shell descriptors", - "description" : "The endpoint Triggers reload of shell descriptors.", - "operationId" : "reload", - "responses" : { - "401" : { - "description" : "Authorization failed.", + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3214,8 +3155,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3224,8 +3165,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3234,8 +3175,44 @@ } } }, - "202" : { - "description" : "Created registry reload job." + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/registry/reload" : { + "get" : { + "tags" : [ + "Registry" + ], + "summary" : "Triggers reload of shell descriptors", + "description" : "The endpoint Triggers reload of shell descriptors.", + "operationId" : "reload", + "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, "400" : { "description" : "Bad request.", @@ -3247,8 +3224,21 @@ } } }, - "429" : { - "description" : "Too many requests.", + "202" : { + "description" : "Created registry reload job." + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3267,8 +3257,18 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3296,18 +3296,18 @@ "description" : "The endpoint returns all policies .", "operationId" : "policy", "responses" : { - "200" : { - "description" : "Returns the policies", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3316,8 +3316,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3326,8 +3326,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3336,8 +3336,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3356,18 +3356,18 @@ } } }, - "500" : { - "description" : "Internal server error.", + "200" : { + "description" : "Returns the policies", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3493,8 +3493,8 @@ "description" : "The endpoint can return limited data based on the user role", "operationId" : "dashboard", "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3503,18 +3503,18 @@ } } }, - "200" : { - "description" : "Returns dashboard data", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3523,18 +3523,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "200" : { + "description" : "Returns dashboard data", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3543,8 +3543,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3553,8 +3553,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3563,8 +3563,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3603,8 +3603,8 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -3613,22 +3613,25 @@ } } }, - "200" : { - "description" : "OK.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415" : { - "description" : "Unsupported media type", + "204" : { + "description" : "No Content." + }, + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } @@ -3643,8 +3646,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -3653,8 +3656,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -3663,11 +3666,8 @@ } } }, - "204" : { - "description" : "No Content." - }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3676,8 +3676,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3723,6 +3723,66 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3924,66 +3984,6 @@ } } } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "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" - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -4046,8 +4046,8 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4056,8 +4056,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4076,18 +4076,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4096,23 +4101,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4121,8 +4121,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4160,28 +4160,8 @@ } ], "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4200,16 +4180,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -4397,6 +4367,26 @@ } } }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "500" : { "description" : "Internal server error.", "content" : { @@ -4407,8 +4397,18 @@ } } }, - "404" : { - "description" : "Not found.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4454,8 +4454,58 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4656,58 +4706,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "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" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4777,8 +4777,8 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4787,8 +4787,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4807,18 +4807,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4827,23 +4832,18 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4852,8 +4852,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4881,18 +4881,23 @@ "description" : "The endpoint returns a map for assets consumed by the map.", "operationId" : "assetsCountryMap", "responses" : { - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the assets found", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "415" : { - "description" : "Unsupported media type", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -4901,8 +4906,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4911,8 +4916,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4921,8 +4926,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -4931,23 +4936,18 @@ } } }, - "200" : { - "description" : "Returns the assets found", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4956,8 +4956,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4995,8 +4995,48 @@ } ], "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5192,36 +5232,6 @@ } } }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -5232,18 +5242,8 @@ } } }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5271,8 +5271,8 @@ "description" : "Deletes all submodels from the system.", "operationId" : "deleteSubmodels", "responses" : { - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5281,11 +5281,8 @@ } } }, - "200" : { - "description" : "Ok." - }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5294,6 +5291,9 @@ } } }, + "200" : { + "description" : "Ok." + }, "403" : { "description" : "Forbidden.", "content" : { @@ -5304,8 +5304,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5314,8 +5314,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5327,8 +5327,8 @@ "204" : { "description" : "No Content." }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5337,8 +5337,8 @@ } } }, - "404" : { - "description" : "Not found.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5376,11 +5376,8 @@ } ], "responses" : { - "200" : { - "description" : "Okay" - }, - "401" : { - "description" : "Authorization failed.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -5389,11 +5386,8 @@ } } }, - "204" : { - "description" : "Deleted." - }, - "415" : { - "description" : "Unsupported media type", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5412,8 +5406,11 @@ } } }, - "400" : { - "description" : "Bad request.", + "204" : { + "description" : "Deleted." + }, + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -5422,8 +5419,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -5432,8 +5429,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5442,8 +5439,11 @@ } } }, - "404" : { - "description" : "Not found.", + "200" : { + "description" : "Okay" + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5512,7 +5512,8 @@ }, "StartQualityNotificationRequest" : { "required" : [ - "severity" + "severity", + "type" ], "type" : "object", "properties" : { From cea4b51a3158ed2a5cace7eff2deecce08d75a07 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Mon, 25 Mar 2024 12:01:22 +0100 Subject: [PATCH 11/13] chore(tx-backend) 706 added filtering and sorting tests on type field. fixed bug where response had null type --- .../mapper/NotificationResponseMapper.java | 1 + .../mapper/QualityNotificationMapper.java | 7 ++ .../InvestigationControllerFilterIT.java | 89 +++++++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java index e834877a0d..c7d2c1560f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/NotificationResponseMapper.java @@ -52,6 +52,7 @@ public static QualityNotificationResponse from(QualityNotification qualityNotifi .createdDate(qualityNotification.getCreatedAt().toString()) .assetIds(Collections.unmodifiableList(qualityNotification.getAssetIds())) .channel(QualityNotificationMapper.from(qualityNotification.getNotificationSide())) + .type(QualityNotificationMapper.from(qualityNotification.getNotificationType())) .reason(new QualityNotificationReasonResponse( qualityNotification.getCloseReason(), qualityNotification.getAcceptReason(), diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java index 5aaf6add7f..0677b665a8 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationMapper.java @@ -24,10 +24,13 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import qualitynotification.base.response.QualityNotificationMessageResponse; +import qualitynotification.base.response.QualityNotificationResponse; import qualitynotification.base.response.QualityNotificationSeverityResponse; import qualitynotification.base.response.QualityNotificationSideResponse; import qualitynotification.base.response.QualityNotificationStatusResponse; +import qualitynotification.base.response.QualityNotificationTypeResponse; import java.util.List; @@ -46,6 +49,10 @@ public static QualityNotificationStatusResponse from(QualityNotificationStatus q return QualityNotificationStatusResponse.fromStringValue(qualityNotificationStatus.name()); } + public static QualityNotificationTypeResponse from(QualityNotificationType qualityNotificationType) { + return QualityNotificationTypeResponse.valueOf(qualityNotificationType.name()); + } + public static List fromNotifications(List notificationMessages) { return notificationMessages.stream().map(QualityNotificationMapper::fromNotification).toList(); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java index 9f7182cbc1..db75541aa6 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java @@ -26,6 +26,7 @@ import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest; import org.eclipse.tractusx.traceability.common.request.SearchCriteriaRequestParam; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; @@ -54,6 +55,8 @@ class InvestigationControllerFilterIT extends IntegrationTestSpecification { @Autowired InvestigationNotificationsSupport investigationNotificationSupport; + @Autowired + AlertsSupport alertsSupport; @Autowired AssetsSupport assetsSupport; @@ -213,6 +216,92 @@ void givenInvestigations_whenSendToFilter_thenExpectedResult() throws JoseExcept .body("content", Matchers.hasSize(8)); } + @Test + void givenInvestigationsAndAlerts_whenTypeFilter_thenExpectedResult() throws JoseException { + // given + investigationNotificationSupport.defaultInvestigationsStored(); + alertsSupport.defaultReceivedAlertStored(); + String filter = "type,EQUAL,INVESTIGATION,AND"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .body(new PageableFilterRequest(new OwnPageable(0, 10, Collections.emptyList()), new SearchCriteriaRequestParam(List.of(filter)))) + .contentType(ContentType.JSON) + .when() + .post("/api/notifications/filter") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(14)) + .body("content", Matchers.hasSize(10)); + } + + @Test + void givenInvestigationsAndAlerts_whenSortByTypeAsc_thenExpectedResult() throws JoseException { + // given + investigationNotificationSupport.defaultInvestigationsStored(); + alertsSupport.defaultReceivedAlertStored(); + String sortString = "type,ASC"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of()))) + .contentType(ContentType.JSON) + .when() + .post("/api/notifications/filter") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(15)) + .body("content", Matchers.hasSize(10)) + .body("content.type", Matchers.containsInRelativeOrder( + "ALERT", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION")); + } + + @Test + void givenInvestigationsAndAlerts_whenSortByTypeDesc_thenExpectedResult() throws JoseException { + // given + investigationNotificationSupport.defaultInvestigationsStored(); + alertsSupport.defaultReceivedAlertStored(); + String sortString = "type,DESC"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .body(new PageableFilterRequest(new OwnPageable(0, 10, List.of(sortString)), new SearchCriteriaRequestParam(List.of()))) + .contentType(ContentType.JSON) + .when() + .post("/api/notifications/filter") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(15)) + .body("content", Matchers.hasSize(10)) + .body("content.type", Matchers.containsInRelativeOrder( + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION", + "INVESTIGATION")); + } + @Test void givenInvestigations_whenSendToFilterAndSort_thenExpectedResult() throws JoseException { // given From e178fe46fadbc275bc7258b2890fb597b642650d Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Mon, 25 Mar 2024 12:47:22 +0100 Subject: [PATCH 12/13] chore(tx-backend) 706 added possibility to filter and sort by title --- .../notification/mapper/QualityNotificationFieldMapper.java | 1 + .../traceability/integration/common/support/AlertsSupport.java | 1 + 2 files changed, 2 insertions(+) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java index eaaf1eb5e8..6bcba53c18 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/mapper/QualityNotificationFieldMapper.java @@ -45,6 +45,7 @@ public class QualityNotificationFieldMapper extends BaseRequestFieldMapper { Map.entry("sendToName", "messages_sendToName"), Map.entry("targetDate", "messages_targetDate"), Map.entry("assetId", "assets_id"), + Map.entry("title", "title"), Map.entry("type", "type") ); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java index 4c42c320b3..15b65dec83 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertsSupport.java @@ -48,6 +48,7 @@ public class AlertsSupport { public Long defaultReceivedAlertStored() { NotificationEntity entity = NotificationEntity.builder() + .title("test") .assets(Collections.emptyList()) .bpn("BPNL00000003AXS3") .status(NotificationStatusBaseEntity.RECEIVED) From 2bb844922d63ed2c194faf6390268881482579b4 Mon Sep 17 00:00:00 2001 From: ds-ext-sceronik Date: Mon, 25 Mar 2024 13:11:15 +0100 Subject: [PATCH 13/13] chore(tx-backend) 706 add swagger doc to NotificationController and notificationType is taken from enum for distinct filter values endpoint --- .../openapi/traceability-foss-backend.json | 2040 +++++++++++------ .../rest/NotificationController.java | 440 ++++ .../base/model/QualityNotificationType.java | 4 +- .../AbstractQualityNotificationService.java | 5 +- .../alert/AlertControllerFilterValuesIT.java | 4 + .../InvestigationTestDataFactory.java | 5 + 6 files changed, 1841 insertions(+), 657 deletions(-) diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 32fab502ff..cc3633dad5 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -41,18 +41,8 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -76,6 +66,16 @@ } } }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "415" : { "description" : "Unsupported media type", "content" : { @@ -96,8 +96,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -106,8 +106,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -158,8 +158,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -168,23 +168,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -193,8 +188,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -203,8 +198,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -213,18 +208,23 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -275,8 +275,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -285,23 +285,18 @@ } } }, - "200" : { - "description" : "Returns the paged result found for BpnEdcMapping", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "415" : { + "description" : "Unsupported media type", "content" : { "application/json" : { "schema" : { @@ -310,8 +305,8 @@ } } }, - "415" : { - "description" : "Unsupported media type", + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -320,8 +315,8 @@ } } }, - "500" : { - "description" : "Internal server error.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -330,18 +325,23 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnEdcMappingResponse" + } } } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -389,8 +389,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -409,8 +409,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -439,8 +439,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -449,8 +449,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -506,8 +506,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -519,8 +519,8 @@ "200" : { "description" : "Ok." }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -552,8 +552,8 @@ "204" : { "description" : "No Content." }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -562,8 +562,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -587,7 +587,9 @@ "tags" : [ "Notifications" ], - "operationId" : "alertAssets", + "summary" : "Start notification by part ids", + "description" : "The endpoint starts notification based on part ids provided.", + "operationId" : "notifyAssets", "requestBody" : { "content" : { "application/json" : { @@ -599,8 +601,58 @@ "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "201" : { - "description" : "Created", + "description" : "Created.", "content" : { "application/json" : { "schema" : { @@ -608,50 +660,45 @@ } } } - } - } - } - }, - "/notifications/{notificationId}/update" : { - "post" : { - "tags" : [ - "Notifications" - ], - "operationId" : "updateAlert", - "parameters" : [ - { - "name" : "notificationId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } } } }, - "required" : true + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } }, - "responses" : { - "204" : { - "description" : "No Content" + "security" : [ + { + "oAuth2" : [ + "profile email" + ] } - } + ] } }, - "/notifications/{notificationId}/close" : { + "/notifications/{notificationId}/update" : { "post" : { "tags" : [ "Notifications" ], - "operationId" : "closeAlert", + "summary" : "Update notification by id", + "description" : "The endpoint updates notification by their id.", + "operationId" : "updateNotification", "parameters" : [ { "name" : "notificationId", @@ -667,17 +714,210 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/CloseQualityNotificationRequest" + "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" } } }, "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "204" : { - "description" : "No Content" + "description" : "No content." + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/notifications/{notificationId}/close" : { + "post" : { + "tags" : [ + "Notifications" + ], + "summary" : "Close notification by id", + "description" : "The endpoint closes alert by id.", + "operationId" : "closeNotification", + "parameters" : [ + { + "name" : "notificationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CloseQualityNotificationRequest" + } + } + }, + "required" : true + }, + "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "204" : { + "description" : "No content." + }, + "200" : { + "description" : "Ok." + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/notifications/{notificationId}/cancel" : { @@ -685,7 +925,9 @@ "tags" : [ "Notifications" ], - "operationId" : "cancelAlert", + "summary" : "Cancels notification by id", + "description" : "The endpoint cancels notification by id.", + "operationId" : "cancelNotification", "parameters" : [ { "name" : "notificationId", @@ -698,10 +940,90 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Ok." + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "204" : { - "description" : "No Content" + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/notifications/{notificationId}/approve" : { @@ -709,7 +1031,9 @@ "tags" : [ "Notifications" ], - "operationId" : "approveAlert", + "summary" : "Approves notification by id", + "description" : "The endpoint approves notification by id.", + "operationId" : "approveNotification", "parameters" : [ { "name" : "notificationId", @@ -722,10 +1046,90 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Ok." + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "204" : { - "description" : "No Content" + "description" : "No content." + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/notifications/filter" : { @@ -733,7 +1137,9 @@ "tags" : [ "Notifications" ], - "operationId" : "getAlerts", + "summary" : "Filter notifications defined by the request body", + "description" : "The endpoint returns notifications as paged result.", + "operationId" : "filterNotifications", "requestBody" : { "content" : { "application/json" : { @@ -742,26 +1148,231 @@ } } }, - "required" : true - }, - "responses" : { + "required" : true + }, + "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { - "description" : "OK", + "description" : "Returns the paged result found for Notifications", "content" : { "application/json" : { "schema" : { "maxItems" : 2147483647, - "minItems" : 0, "type" : "array", - "description" : "PageResults", + "description" : "Notifications", "items" : { - "$ref" : "#/components/schemas/PageResultQualityNotificationResponse" + "type" : "object", + "properties" : { + "id" : { + "maximum" : 255, + "minimum" : 0, + "maxLength" : 255, + "type" : "integer", + "format" : "int64", + "example" : 66 + }, + "title" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Title" + }, + "status" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "CREATED", + "enum" : [ + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + ] + }, + "description" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string", + "example" : "DescriptionText" + }, + "createdBy" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003AYRE" + }, + "createdByName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "createdDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "2023-02-21T21:27:10.734950Z" + }, + "assetIds" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "example" : [ + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd", + "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd" + ], + "items" : { + "type" : "string", + "example" : "[\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70529fcbd\",\"urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70530fcbd\"]" + } + }, + "channel" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "SENDER", + "enum" : [ + "SENDER", + "RECEIVER" + ] + }, + "reason" : { + "$ref" : "#/components/schemas/QualityNotificationReasonResponse" + }, + "sendTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "BPNL00000003AYRE" + }, + "sendToName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "Tier C" + }, + "severity" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "example" : "MINOR", + "enum" : [ + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE-THREATENING" + ] + }, + "type" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "ALERT", + "enum" : [ + "ALERT", + "INVESTIGATION" + ] + }, + "targetDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string", + "example" : "2099-02-21T21:27:10.734950Z" + }, + "messages" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationMessageResponse" + } + } + } } } } } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/edc/notification/contract" : { @@ -793,8 +1404,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -803,8 +1414,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -843,8 +1454,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -853,8 +1464,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1050,8 +1661,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1063,8 +1674,8 @@ "204" : { "description" : "No Content." }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1093,8 +1704,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "OK.", + "content" : { + "application/json" : {} + } + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1103,14 +1720,8 @@ } } }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1156,18 +1767,18 @@ } }, "responses" : { - "404" : { - "description" : "Not found.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportResponse" } } } }, - "400" : { - "description" : "Bad request.", + "404" : { + "description" : "Not found.", "content" : { "application/json" : { "schema" : { @@ -1176,21 +1787,21 @@ } } }, - "204" : { - "description" : "No Content." - }, - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1219,8 +1830,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1229,8 +1840,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1278,8 +1889,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1288,8 +1899,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1321,8 +1932,8 @@ "201" : { "description" : "Created." }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1331,8 +1942,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1380,8 +1991,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1390,8 +2001,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1612,8 +2223,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1622,8 +2233,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1671,8 +2282,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1681,8 +2292,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -1714,8 +2325,8 @@ "201" : { "description" : "Created." }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -1724,8 +2335,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -1760,11 +2371,21 @@ } } }, - "required" : true - }, - "responses" : { - "404" : { - "description" : "Not found.", + "required" : true + }, + "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -1773,8 +2394,28 @@ } } }, - "400" : { - "description" : "Bad request.", + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -1975,38 +2616,8 @@ } } }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2015,8 +2626,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2054,6 +2665,56 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the assets found", "content" : { @@ -2241,16 +2902,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "400" : { "description" : "Bad request.", "content" : { @@ -2270,46 +2921,6 @@ } } } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -2358,8 +2969,38 @@ } } }, - "400" : { - "description" : "Bad request.", + "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" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", "content" : { "application/json" : { "schema" : { @@ -2529,64 +3170,34 @@ "type" : "string", "example" : "TRANSIENT", "enum" : [ - "TRANSIENT", - "PERSISTENT", - "ERROR", - "IN_SYNCHRONIZATION", - "PUBLISHED_TO_CORE_SERVICES", - "UNSET" - ] - }, - "importNote" : { - "type" : "string", - "example" : "Asset created successfully in transient state" - }, - "tombstone" : { - "type" : "string", - "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" - }, - "contractAgreementId" : { - "type" : "string", - "example" : "TODO" - } - } - } - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "TRANSIENT", + "PERSISTENT", + "ERROR", + "IN_SYNCHRONIZATION", + "PUBLISHED_TO_CORE_SERVICES", + "UNSET" + ] + }, + "importNote" : { + "type" : "string", + "example" : "Asset created successfully in transient state" + }, + "tombstone" : { + "type" : "string", + "example" : " {\n \"catenaXId\": \"urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5\",\n \"endpointURL\": \"https://irs-provider-dataplane3.dev.demo.catena-x.net/api/public/data/urn:uuid:c7b3ea3d-97ea-41e4-960d-12fb166e1da1\",\n \"processingError\": {\n \"processStep\": \"SubmodelRequest\",\n \"errorDetail\": \"org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : \"{\"errors\":[]}\"\",\n \"lastAttempt\": \"2024-02-07T12:06:34.400493282Z\",\n \"retryCounter\": 0\n },\n \"policy\": null\n }\n" + }, + "contractAgreementId" : { + "type" : "string", + "example" : "TODO" + } + } + } } } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2595,8 +3206,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2644,8 +3255,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -2841,8 +3452,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -2871,8 +3482,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -2881,8 +3492,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -2928,6 +3539,56 @@ "required" : true }, "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "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" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { "description" : "Returns the updated asset", "content" : { @@ -3115,16 +3776,6 @@ } } }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "400" : { "description" : "Bad request.", "content" : { @@ -3144,46 +3795,6 @@ } } } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } } }, "security" : [ @@ -3214,8 +3825,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3227,8 +3838,8 @@ "202" : { "description" : "Created registry reload job." }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3257,8 +3868,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3267,8 +3878,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3306,8 +3917,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3316,8 +3927,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3346,28 +3957,28 @@ } } }, - "429" : { - "description" : "Too many requests.", + "200" : { + "description" : "Returns the policies", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/PolicyResponse" } } } }, - "200" : { - "description" : "Returns the policies", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3391,7 +4002,9 @@ "tags" : [ "Notifications" ], - "operationId" : "getAlert", + "summary" : "Gets notification by id", + "description" : "The endpoint returns notification by id.", + "operationId" : "getNotification", "parameters" : [ { "name" : "notificationId", @@ -3404,22 +4017,99 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { - "description" : "OK", + "description" : "OK.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Notifications", + "items" : { + "$ref" : "#/components/schemas/QualityNotificationResponse" + } + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Notifications", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationResponse" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/notifications/distinctFilterValues" : { @@ -3427,6 +4117,8 @@ "tags" : [ "Notifications" ], + "summary" : "getDistinctFilterValues", + "description" : "The endpoint returns a distinct filter values for given fieldName of notification.", "operationId" : "distinctFilterValues", "parameters" : [ { @@ -3468,11 +4160,23 @@ } ], "responses" : { + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, "200" : { - "description" : "OK", + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, "type" : "array", "items" : { "type" : "string" @@ -3480,8 +4184,75 @@ } } } + }, + "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" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } - } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] } }, "/dashboard" : { @@ -3503,8 +4274,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3513,22 +4284,22 @@ } } }, - "403" : { - "description" : "Forbidden.", + "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" } } } @@ -3553,8 +4324,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3563,8 +4334,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3613,31 +4384,31 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "OK.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "$ref" : "#/components/schemas/ImportReportResponse" } } } }, - "204" : { - "description" : "No Content." - }, - "200" : { - "description" : "OK.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ImportReportResponse" + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403" : { - "description" : "Forbidden.", + "204" : { + "description" : "No Content." + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3666,8 +4437,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -3676,8 +4447,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -3733,8 +4504,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -3743,8 +4514,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -3773,16 +4544,6 @@ } } }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the paged result found for Asset", "content" : { @@ -3975,8 +4736,18 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4056,18 +4827,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4076,17 +4852,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -4111,8 +4882,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4121,8 +4892,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4170,16 +4941,6 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "200" : { "description" : "Returns the asset by childId", "content" : { @@ -4367,8 +5128,18 @@ } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4397,8 +5168,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4406,9 +5177,9 @@ } } } - }, - "401" : { - "description" : "Authorization failed.", + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4464,46 +5235,6 @@ } } }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, "429" : { "description" : "Too many requests.", "content" : { @@ -4715,6 +5446,46 @@ } } } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } } }, "security" : [ @@ -4787,18 +5558,23 @@ } } }, - "400" : { - "description" : "Bad request.", + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } } } } }, - "403" : { - "description" : "Forbidden.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4807,17 +5583,12 @@ } } }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } + "$ref" : "#/components/schemas/ErrorResponse" } } } @@ -4842,8 +5613,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4852,8 +5623,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -4881,21 +5652,6 @@ "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" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, "404" : { "description" : "Not found.", "content" : { @@ -4906,8 +5662,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -4916,8 +5672,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -4946,8 +5702,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -4956,8 +5712,23 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "200" : { + "description" : "Returns the assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } + }, + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5005,8 +5776,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5015,8 +5786,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5232,8 +6003,8 @@ } } }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5242,8 +6013,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5281,8 +6052,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5294,8 +6065,8 @@ "200" : { "description" : "Ok." }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5327,8 +6098,8 @@ "204" : { "description" : "No Content." }, - "429" : { - "description" : "Too many requests.", + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5337,8 +6108,8 @@ } } }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5386,8 +6157,8 @@ } } }, - "400" : { - "description" : "Bad request.", + "429" : { + "description" : "Too many requests.", "content" : { "application/json" : { "schema" : { @@ -5396,8 +6167,8 @@ } } }, - "403" : { - "description" : "Forbidden.", + "401" : { + "description" : "Authorization failed.", "content" : { "application/json" : { "schema" : { @@ -5406,9 +6177,6 @@ } } }, - "204" : { - "description" : "Deleted." - }, "415" : { "description" : "Unsupported media type", "content" : { @@ -5429,8 +6197,14 @@ } } }, - "429" : { - "description" : "Too many requests.", + "204" : { + "description" : "Deleted." + }, + "200" : { + "description" : "Okay" + }, + "400" : { + "description" : "Bad request.", "content" : { "application/json" : { "schema" : { @@ -5439,11 +6213,8 @@ } } }, - "200" : { - "description" : "Okay" - }, - "401" : { - "description" : "Authorization failed.", + "403" : { + "description" : "Forbidden.", "content" : { "application/json" : { "schema" : { @@ -5665,45 +6436,6 @@ } } }, - "PageResultQualityNotificationResponse" : { - "type" : "object", - "properties" : { - "content" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "description" : "Content of PageResults", - "items" : { - "maxItems" : 2147483647, - "type" : "array", - "description" : "Notifications", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationResponse" - } - } - }, - "page" : { - "type" : "integer", - "format" : "int32", - "example" : 1 - }, - "pageCount" : { - "type" : "integer", - "format" : "int32", - "example" : 15 - }, - "pageSize" : { - "type" : "integer", - "format" : "int32", - "example" : 10 - }, - "totalItems" : { - "type" : "integer", - "format" : "int64", - "example" : 2 - } - } - }, "QualityNotificationMessageResponse" : { "type" : "object", "properties" : { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java index 5e367d8464..e1ae35e7cb 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/notification/rest/NotificationController.java @@ -19,7 +19,15 @@ package org.eclipse.tractusx.traceability.qualitynotification.application.notification.rest; +import assets.importpoc.ErrorResponse; import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import jakarta.ws.rs.QueryParam; @@ -77,6 +85,54 @@ public NotificationController( this.fieldMapper = fieldMapper; } + @Operation(operationId = "notifyAssets", + summary = "Start notification by part ids", + tags = {"Notifications"}, + description = "The endpoint starts notification based on part ids provided.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Created."), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @ResponseStatus(HttpStatus.CREATED) @@ -86,6 +142,60 @@ public QualityNotificationIdResponse alertAssets(@RequestBody @Valid StartQualit return new QualityNotificationIdResponse(notificationService.start(from(cleanStartQualityNotificationRequest)).value()); } + @Operation(operationId = "filterNotifications", + summary = "Filter notifications defined by the request body", + tags = {"Notifications"}, + description = "The endpoint returns notifications as paged result.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns the paged result found for Notifications", content = @Content( + mediaType = "application/json", + array = @ArraySchema(arraySchema = @Schema(description = "AlertData", implementation = QualityNotificationResponse.class, additionalProperties = Schema.AdditionalPropertiesValue.FALSE), maxItems = Integer.MAX_VALUE), + schema = @Schema(implementation = QualityNotificationResponse.class) + )), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping("/filter") public PageResult getAlerts(@Valid @RequestBody PageableFilterRequest pageableFilterRequest) { log.info(RECEIVED_API_CALL_LOG + "/filter"); @@ -96,12 +206,118 @@ public PageResult getAlerts(@Valid @RequestBody Pag pageableFilterRequest.getSearchCriteriaRequestParam().toSearchCriteria(fieldMapper))); } + @Operation(operationId = "getNotification", + summary = "Gets notification by id", + tags = {"Notifications"}, + description = "The endpoint returns notification by id.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK."), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("/{notificationId}") public QualityNotificationResponse getAlert(@PathVariable("notificationId") Long notificationId) { log.info(RECEIVED_API_CALL_LOG + "/{}", notificationId); return NotificationResponseMapper.from(notificationService.find(notificationId)); } + @Operation(operationId = "approveNotification", + summary = "Approves notification by id", + tags = {"Notifications"}, + description = "The endpoint approves notification by id.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), + @ApiResponse( + responseCode = "204", + description = "No content."), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping("/{notificationId}/approve") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @ResponseStatus(HttpStatus.NO_CONTENT) @@ -110,6 +326,62 @@ public void approveAlert(@PathVariable("notificationId") Long notificationId) { notificationService.approve(notificationId); } + @Operation(operationId = "cancelNotification", + summary = "Cancels notification by id", + tags = {"Notifications"}, + description = "The endpoint cancels notification by id.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "Ok."), + @ApiResponse( + responseCode = "204", + description = "No content."), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping("/{notificationId}/cancel") @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @ResponseStatus(HttpStatus.NO_CONTENT) @@ -118,6 +390,62 @@ public void cancelAlert(@PathVariable("notificationId") Long notificationId) { notificationService.cancel(notificationId); } + @Operation(operationId = "closeNotification", + summary = "Close notification by id", + tags = {"Notifications"}, + 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.", + content = @Content()), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR')") @PostMapping("/{notificationId}/close") @ResponseStatus(HttpStatus.NO_CONTENT) @@ -129,6 +457,59 @@ public void closeAlert( notificationService.update(notificationId, QualityNotificationStatus.from(QualityNotificationStatusRequest.CLOSED), cleanCloseAlertRequest.getReason()); } + @Operation(operationId = "updateNotification", + summary = "Update notification by id", + tags = {"Notifications"}, + description = "The endpoint updates notification by their id.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = { + @ApiResponse( + responseCode = "204", + description = "No content.", + content = @Content()), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @PreAuthorize("hasAnyRole('ROLE_SUPERVISOR', 'ROLE_USER')") @PostMapping("/{notificationId}/update") @ResponseStatus(HttpStatus.NO_CONTENT) @@ -141,6 +522,65 @@ public void updateAlert( notificationService.update(notificationId, QualityNotificationStatus.from(cleanUpdateAlertRequest.getStatus()), cleanUpdateAlertRequest.getReason()); } + @Operation(operationId = "distinctFilterValues", + summary = "getDistinctFilterValues", + tags = {"Notifications"}, + description = "The endpoint returns a distinct filter values for given fieldName of notification.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns a distinct filter values for given fieldName.", content = @Content( + mediaType = "application/json", + array = @ArraySchema( + schema = @Schema( + description = "FilterValues", + implementation = String.class, + additionalProperties = Schema.AdditionalPropertiesValue.FALSE + ), + maxItems = Integer.MAX_VALUE, + minItems = 0) + )), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) @GetMapping("distinctFilterValues") public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { return notificationService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java index e2e695d6c7..a5292d17b0 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/model/QualityNotificationType.java @@ -22,8 +22,8 @@ import qualitynotification.base.request.QualityNotificationTypeRequest; public enum QualityNotificationType { - INVESTIGATION("INVESTIGATION"), - ALERT("ALERT"); + ALERT("ALERT"), + INVESTIGATION("INVESTIGATION"); private final String realName; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 675ec6ed56..3b81cfa675 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -24,6 +24,7 @@ import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.eclipse.tractusx.traceability.qualitynotification.application.notification.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import org.eclipse.tractusx.traceability.qualitynotification.domain.notification.model.StartQualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; @@ -47,7 +48,7 @@ public abstract class AbstractQualityNotificationService implements QualityNotif private final TraceabilityProperties traceabilityProperties; private final NotificationPublisherService notificationPublisherService; - private static final List SUPPORTED_ENUM_FIELDS = List.of("status", "side", "messages_severity"); + private static final List SUPPORTED_ENUM_FIELDS = List.of("status", "side", "messages_severity", "type"); protected abstract QualityNotificationRepository getQualityNotificationRepository(); @@ -174,6 +175,8 @@ private List getAssetEnumFieldValues(String fieldName) { case "side" -> Arrays.stream(QualityNotificationSide.values()).map(Enum::name).toList(); case "messages_severity" -> Arrays.stream(QualityNotificationSeverity.values()).map(Enum::name).toList(); + case "type" -> + Arrays.stream(QualityNotificationType.values()).map(Enum::name).toList(); default -> null; }; } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java index d07333c16a..3e3dc7dc7c 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java @@ -419,6 +419,10 @@ private static Stream enumFieldNamesTestProvider() { "MAJOR", "CRITICAL", "LIFE_THREATENING" + )), + Arguments.of("type", 200, List.of( + "ALERT", + "INVESTIGATION" )) ); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/InvestigationTestDataFactory.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/InvestigationTestDataFactory.java index 4faa4ae291..4a94c60643 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/InvestigationTestDataFactory.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/testdata/InvestigationTestDataFactory.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationType; import java.time.Instant; import java.util.ArrayList; @@ -65,6 +66,7 @@ public static QualityNotification createInvestigationTestData(QualityNotificatio .notificationStatus(investigationStatus) .notificationSide(investigationSide) .description(description) + .notificationType(QualityNotificationType.INVESTIGATION) .createdAt(createdAt) .assetIds(assetIds) .notifications(notifications) @@ -110,6 +112,7 @@ public static QualityNotification createInvestigationTestData(QualityNotificatio .contractAgreementId("agreement") .description(description) .notificationStatus(notificationInvestigationStatus) + .type(QualityNotificationType.INVESTIGATION) .affectedParts(List.of(new QualityNotificationAffectedPart("part123"))) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") @@ -126,6 +129,7 @@ public static QualityNotification createInvestigationTestData(QualityNotificatio .contractAgreementId("agreement") .description(description) .notificationStatus(QualityNotificationStatus.SENT) + .type(QualityNotificationType.INVESTIGATION) .affectedParts(List.of(new QualityNotificationAffectedPart("part123"))) .severity(QualityNotificationSeverity.MINOR) .edcNotificationId("123") @@ -142,6 +146,7 @@ public static QualityNotification createInvestigationTestData(QualityNotificatio .notificationSide(investigationSide) .description(description) .createdAt(createdAt) + .notificationType(QualityNotificationType.INVESTIGATION) .assetIds(assetIds) .notifications(notifications) .build();