diff --git a/CHANGELOG.md b/CHANGELOG.md index 8716bf7095..1b88fec894 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,13 @@ _**For better traceability add the corresponding GitHub issue number in each cha ### Added - #421 Added contract agreement view - #515 Service Unavailable Response on Notification failure -- #536 Added import state PUBLISHED_TO_CX in frontend +- #536 Added import state PUBLISHED_TO_CORE_SERVICES in frontend - #420 add /contracts api to fetch contract agreement information from EDC for assets - Added a step to the pull-request-backend.yml which checks if the pom.xml(root) properties have some versions ending with -SNAPSHOT - Added a PostConstruct method in PolicyStartUpConfig to allow Integration tests to run without errors in stack traces. +- #536 added new ImportState to asset PUBLISHED_TO_CORE_SERVICES indicating edc assets and dtr shells were created for given asset +- #536 added cron job responsible to publish assets in PUBLISHED_TO_CORE_SERVICES import state to edc and dtr + ### Changed - Updated RELEASE.md to the latest release guide (added more steps) - #515 Fixed notification toast click area @@ -23,6 +26,8 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #423 Moved errorMessages from investigation/alert to notification list - Updated COMPATIBILITY.md matrix adding release C-X 24.3 and 23.12 - #536 rework /policies to respond with policies from the IRS policy store +- #536 sync assets logic was adjusted to create IRS jobs only for assets that are not in TRANSIENT or IN_SYNC states +- #536 Updated Arc42 documentation and user-manual with publish assets informations ### Removed - #625 Removed the header and breadcrumbs section from app layout diff --git a/charts/traceability-foss/charts/backend/templates/deployment.yaml b/charts/traceability-foss/charts/backend/templates/deployment.yaml index 8406a6f648..3c053b3bc2 100644 --- a/charts/traceability-foss/charts/backend/templates/deployment.yaml +++ b/charts/traceability-foss/charts/backend/templates/deployment.yaml @@ -98,6 +98,12 @@ spec: value: {{ .Values.edc.apiKey | quote }} - name: EDC_PROVIDER_URL value: {{ .Values.edc.providerUrl | quote }} + - name: EDC_PROVIDER_DATAPLANE_URL + value: {{ .Values.edc.providerDataplaneUrl | quote }} + - name: REGISTRY_URL_WITH_PATH + value: {{ .Values.registry.urlWithPath | quote }} + - name: REGISTRY_ALLOWED_BPNS + value: {{ .Values.registry.allowedBpns | quote }} - name: SUBMODEL_URL value: {{ .Values.submodel.baseUrl | quote }} - name: IRS_URL diff --git a/charts/traceability-foss/charts/backend/values.yaml b/charts/traceability-foss/charts/backend/values.yaml index f03a46e34b..4ebb25b007 100644 --- a/charts/traceability-foss/charts/backend/values.yaml +++ b/charts/traceability-foss/charts/backend/values.yaml @@ -169,6 +169,7 @@ irs: baseUrl: "https://replace.me" registry: urlWithPath: "https://replace.me" + allowedBpns: "replace me" portal: baseUrl: "https://replace.me" diff --git a/charts/traceability-foss/values.yaml b/charts/traceability-foss/values.yaml index 3c129e5555..9a63ca1e11 100644 --- a/charts/traceability-foss/values.yaml +++ b/charts/traceability-foss/values.yaml @@ -293,6 +293,8 @@ backend: callbackUrl: "CHANGEME" # example: http://:8181/internal/endpoint-data-reference callbackUrlEdcClient: "CHANGEME" # example: https:///api/internal/endpoint-data-reference dataEndpointUrl: "CHANGEME" # example: https:///management" + partsProviderControlplaneUrl: "CHANGEME" # host of the parts provider EDC + partsProviderDataplaneUrl: "CHANGEME" discoveryfinder: baseUrl: "CHANGEME" # example: https://discoveryfinder.net/discoveryfinder/api/administration/connectors/discovery/search @@ -301,6 +303,7 @@ backend: baseUrl: "https://replace.me" # https:// registry: urlWithPath: "https://replace.me" # digitalTwinRegistry /semantics/registry/api/v3.0 + allowedBpns: "BPN1,BPN2" # "," separated list of allowed bpns for creating shells portal: baseUrl: "https://replace.me" diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 7fc6841e30..0d6d3b5aea 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -4,7 +4,6 @@ ## Release an app - Prerequisite: Make sure eclipse / catena git repositories are in sync diff --git a/docs/src/docs/arc42/runtime-view/data-provisioning.adoc b/docs/src/docs/arc42/runtime-view/data-provisioning.adoc index 7c331d2046..01198ad925 100644 --- a/docs/src/docs/arc42/runtime-view/data-provisioning.adoc +++ b/docs/src/docs/arc42/runtime-view/data-provisioning.adoc @@ -2,7 +2,7 @@ This sequence diagrams describes the process of importing data from a Trace-X Dataformat -Modul 1 +== Modul 1 Data will be imported by the Trace-X Frontend into Trace-X backend and will be persisted as asset by a Trace-X instance in a transient state. The raw data which is needed for the shared services (DTR / EDC) will be persisted as well. @@ -13,7 +13,7 @@ The raw data which is needed for the shared services (DTR / EDC) will be persist include::../../../uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml[] .... -Modul 2 - DRAFT +== Modul 2 The frontend is able to select assets and publish / syncronize them with the shared services. DTR / EDC / Submodel API. @@ -23,7 +23,7 @@ The frontend is able to select assets and publish / syncronize them with the sha include::../../../uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml[] .... -Modul 3 - DRAFT +== Modul 3 The backend is able to persist the data in the DTR / EDC and allows to use IRS for resolving assets. @@ -33,6 +33,9 @@ The backend is able to persist the data in the DTR / EDC and allows to use IRS f include::../../../uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml[] .... -TODO: Add all scenarios for data-provisioning include::data-provisioning/return-import-report.adoc[leveloffset=+1] + +include::data-provisioning/publish-assets.adoc[leveloffset=+1] + +include::data-provisioning/publish-assets-error.adoc[leveloffset=+1] diff --git a/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets-error.adoc b/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets-error.adoc new file mode 100644 index 0000000000..d59fd015fb --- /dev/null +++ b/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets-error.adoc @@ -0,0 +1,14 @@ += Scenario 3: Publish assets Error on EDC or DTR + +This section describes user interaction when publishing assets fails due to EDC or DTR error ( for example services are unavailable ) + +[plantuml,target=import-report-receive,format=svg] +.... +include::../../../../uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml[] +.... + +== Overview + +When a user publishes assets, TraceX-FOSS checks if the user has an adequate role ('ROLE_ADMIN'). +If yes, then endpoint starts to publish assets to network. +If any of required Services are not available or returns Error response upon executing flow assets are set to ERROR state and user can retry publishing them at any time when services are available diff --git a/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets.adoc b/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets.adoc new file mode 100644 index 0000000000..7b0dc448bd --- /dev/null +++ b/docs/src/docs/arc42/runtime-view/data-provisioning/publish-assets.adoc @@ -0,0 +1,13 @@ += Scenario 2: Publish assets + +This section describes user interaction when publishing assets + +[plantuml,target=import-report-receive,format=svg] +.... +include::../../../../uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml[] +.... + +== Overview + +When a user publishes assets, TraceX-FOSS checks if the user has an adequate role ('ROLE_ADMIN'). +If yes, then endpoint starts to publish assets to network. diff --git a/docs/src/docs/user/user-manual.adoc b/docs/src/docs/user/user-manual.adoc index 6591398173..02baa0dc6e 100644 --- a/docs/src/docs/user/user-manual.adoc +++ b/docs/src/docs/user/user-manual.adoc @@ -199,7 +199,10 @@ The following table explains the different import state an asset can have: |Asset is uploaded but not synchronized with the Item Relationship Service (IRS). |in_synchronization -|Asset is in the process of synchronizing with the IRS. +|Asset is ready to be published. + +|published_to_core_services +|Asset is published, EDC assets, DTR shell, Submodel are created |persistent |Asset is successfully synchronized with the IRS. diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-consumption-process.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-consumption-process.puml index d2a1543f78..81e4c40908 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-consumption-process.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-consumption-process.puml @@ -24,7 +24,7 @@ TraceX -> TraceX: Extract globalAssetId as CatenaX UUID TraceX -> TraceX: Filter for new CX UUIDs loop for each new CX_UUID - TraceX -> IRS: Register job to get submodel data + TraceX -> IRS: Register job for assets not in TRANSIENT or IN_SYNC import states to get submodel data rnote right TraceX aspects, globalAssetId, bomLifecycle, collectAspects, direction, depth end rnote diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml new file mode 100644 index 0000000000..13168bf8b9 --- /dev/null +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml @@ -0,0 +1,23 @@ +@startuml +skinparam monochrome true +skinparam shadowing false +autonumber "[000]" + +actor TraceXApiConsumer +activate TraceXApiConsumer + +box "Trace-X FOSS" #LightGrey +participant TraceX +activate TraceX + +TraceXApiConsumer -> TraceX : POST /assets/publish +TraceX -> TraceX : Module 2 fails to create EDC Assets or DTR shells +TraceXApiConsumer -> TraceXApiConsumer : GET /assets +TraceXApiConsumer -> TraceX : POST /assets/publish +TraceX -> TraceX : Module 2 process successfully +TraceXApiConsumer -> TraceXApiConsumer : GET /assets + + + + +@enduml diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml new file mode 100644 index 0000000000..4136d80469 --- /dev/null +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml @@ -0,0 +1,21 @@ +@startuml +skinparam monochrome true +skinparam shadowing false +autonumber "[000]" + +actor TraceXApiConsumer +activate TraceXApiConsumer + +box "Trace-X FOSS" #LightGrey +participant TraceX +activate TraceX + +TraceXApiConsumer -> TraceX : POST /assets/publish +TraceX -> TraceX : Module 2 +TraceXApiConsumer -> TraceXApiConsumer : GET /assets + + + + + +@enduml diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml index 9dcb7459b4..1526c43747 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml @@ -1,15 +1,17 @@ @startuml participant FE participant BE +autonumber "[000]" -FE -> BE: [001] request assets: GET/assetsAsxxx -BE --> FE: [002] return assets_as_built OR assets_as_planned -FE -> FE: [003] present assets -FE -> BE: [004] select assets to synchronize: GET/policies -BE --> FE: [005] return policies -FE -> FE: [006] open detailview & assign policy (via dropdown) -FE -> BE: [007] register assets for publishing: POST/assets/sync -BE --> FE: [008] update asset state to IN_SYNC -BE -> BE: [008] trigger 'publish AAS Workflow' (Job scheduler) -FE -> FE: [009] refresh of FE view +FE -> BE: request assets: GET/assetsAsxxx +BE --> FE: return assets_as_built OR assets_as_planned +FE -> FE: present assets +FE -> BE: select assets to synchronize: GET/policies +BE --> FE: return policies +FE -> FE: open detailview & assign policy (via dropdown) +FE -> BE: register assets for publishing: POST/assets/publish +BE -> BE: update asset state to IN_SYNC +BE -> BE: trigger 'publish AAS Workflow' (Job scheduler) +BE -> BE: trigger 'data consumption process' +FE -> FE: refresh of FE view @enduml diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml index e3902ed4ed..9e23bdf92e 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml @@ -3,19 +3,32 @@ participant BE participant EDC participant Registry participant Submodels +participant Irs +autonumber "[000]" -BE ->> BE: [001] scheduler job -BE ->> BE: [002] receive list of IN_SYNC_assets -BE ->> EDC: [003] create asset in EDC: POST/create/asset -EDC -->> BE: [004] response -BE ->> EDC: [005] create policy in EDC: POST/create/policy -EDC -->> BE: [006] response -BE ->> EDC: [007] create contract in EDC: POST/create/contract -EDC -->> BE: [008] response -BE ->> Submodels: [009] create submodel: POST/submodel -Submodels -->> BE: [010] -BE ->> Registry: [011] register shell in registry: POST/semantics/registry -Registry -->> BE: [012] -BE ->> BE: [013] update asset state PUBLISHED_TO_CX -BE ->> BE: [014] trigger IRS sync +BE ->> BE: scheduler job +BE ->> BE: receive list of IN_SYNC assets +BE ->> Irs: get policy for assets from policy store: GET/irs/policies +Irs -->> BE: response +BE ->> EDC: create policy in EDC: POST/create/policy +EDC -->> BE: response +BE ->> EDC: create DTR asset in EDC: POST/create/asset +EDC -->> BE: response +BE ->> EDC: create DTR contract in EDC: POST/create/contract +EDC -->> BE: response +BE ->> EDC: create Submodel asset in EDC: POST/create/asset +EDC -->> BE: response +BE ->> EDC: create Submodel contract in EDC: POST/create/contract +EDC -->> BE: response +BE ->> Submodels: create submodel: POST/submodel +Submodels -->> BE: +BE ->> Registry: [017] register shell in registry: POST/semantics/registry +alt Successful DTR shell creation +Registry -->> BE: shell created +BE ->> BE: update asset state PUBLISHED_TO_CORE_SERVICES +BE ->> BE: trigger IRS sync +else DTR shell was not created +Registry -->> BE: create shell not successful or service unavailable +BE ->> BE: update asset state ERROR +end @enduml diff --git a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts index 6aa32496ca..6e54c64749 100644 --- a/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts +++ b/frontend/src/app/mocks/services/parts-mock/partsAsBuilt/partsAsBuilt.model.ts @@ -66,7 +66,7 @@ export const mockBmwAssets = [ 'receivedQualityAlertIdsInStatusActive': [], 'sentQualityInvestigationIdsInStatusActive': [], 'receivedQualityInvestigationIdsInStatusActive': [], - 'importState': 'PUBLISHED_TO_CX', + 'importState': 'PUBLISHED_TO_CORE_SERVICES', 'importNote': 'This is a test import note.' }, { diff --git a/frontend/src/app/modules/page/parts/model/parts.model.ts b/frontend/src/app/modules/page/parts/model/parts.model.ts index b2c8159212..5ffd81fea6 100644 --- a/frontend/src/app/modules/page/parts/model/parts.model.ts +++ b/frontend/src/app/modules/page/parts/model/parts.model.ts @@ -176,7 +176,7 @@ export enum ImportState { IN_SYNCHRONIZATION = "IN_SYNCHRONIZATION", ERROR = "ERROR", UNSET = "UNSET", - PUBLISHED_TO_CX="PUBLISHED_TO_CX" + PUBLISHED_TO_CORE_SERVICES="PUBLISHED_TO_CORE_SERVICES" } export enum ImportStateInCamelCase { @@ -185,7 +185,7 @@ export enum ImportStateInCamelCase { IN_SYNCHRONIZATION = "In Synchronization", ERROR = "Error", UNSET = "Unset", - PUBLISHED_TO_CX="Published to CX" + PUBLISHED_TO_CORE_SERVICES="Published to Core Services" } export enum FilterOperator { diff --git a/frontend/src/app/modules/shared/components/chip/chip.component.scss b/frontend/src/app/modules/shared/components/chip/chip.component.scss index 0dabeaaff6..865cae4828 100644 --- a/frontend/src/app/modules/shared/components/chip/chip.component.scss +++ b/frontend/src/app/modules/shared/components/chip/chip.component.scss @@ -23,7 +23,7 @@ background-color: rgb(255,236,189); } - &__PUBLISHED_TO_CX { + &__PUBLISHED_TO_CORE_SERVICES { background-color: rgb(218, 245, 255); } diff --git a/frontend/src/assets/locales/de/common.json b/frontend/src/assets/locales/de/common.json index a99dc08603..03b153dcbd 100644 --- a/frontend/src/assets/locales/de/common.json +++ b/frontend/src/assets/locales/de/common.json @@ -145,7 +145,7 @@ "IN_SYNCHRONIZATION": "IN SYNCHRONISATION", "ERROR": "FEHLER", "UNSET": "UNDEFINIERT", - "PUBLISHED_TO_CX": "VERÖFFENTLICHT" + "PUBLISHED_TO_CORE_SERVICES": "VERÖFFENTLICHT" }, "severity": { "MINOR": "Gering", @@ -336,7 +336,7 @@ "IN_SYNCHRONIZATION": "In Synchronisation", "ERROR": "Fehler", "UNSET": "Undefiniert", - "PUBLISHED_TO_CX": "Veröffentlicht" + "PUBLISHED_TO_CORE_SERVICES": "Veröffentlicht" } }, "parts": { diff --git a/frontend/src/assets/locales/en/common.json b/frontend/src/assets/locales/en/common.json index db7074999e..b9433617ac 100644 --- a/frontend/src/assets/locales/en/common.json +++ b/frontend/src/assets/locales/en/common.json @@ -143,7 +143,7 @@ "IN_SYNCHRONIZATION": "IN SYNCHRONIZATION", "ERROR": "ERROR", "UNSET": "UNSET", - "PUBLISHED_TO_CX": "PUBLISHED" + "PUBLISHED_TO_CORE_SERVICES": "PUBLISHED" }, "severity": { "MINOR": "Minor", @@ -338,7 +338,7 @@ "IN_SYNCHRONIZATION": "In Synchronization", "ERROR": "Error", "UNSET": "Unset", - "PUBLISHED_TO_CX": "Veröffentlicht" + "PUBLISHED_TO_CORE_SERVICES": "Veröffentlicht" } }, diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 61451dd2da..23dfb33fb3 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1,8406 +1 @@ -{ - "openapi" : "3.0.1", - "info" : { - "title" : "Trace-FOSS - OpenAPI Documentation", - "description" : "Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.", - "license" : { - "name" : "License: Apache 2.0" - }, - "version" : "1.0.0" - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "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", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/BpnEdcMappingResponse" - } - } - } - } - }, - "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" : { - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "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" : { - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the paged result found", - "content" : { - "application/json" : {} - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "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" : { - "204" : { - "description" : "No Content.", - "content" : { - "application/json" : {} - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok.", - "content" : { - "application/json" : {} - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" : { - "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" - }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessageResponseList" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - } - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CreateNotificationContractResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/contracts" : { - "post" : { - "tags" : [ - "getContracts", - "Contracts" - ], - "summary" : "All contract agreements for all assets", - "description" : "This endpoint returns all contract agreements for alls assets in Trace-X", - "operationId" : "contracts", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/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." - } - } - } - } - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Not found." - } - } - } - } - }, - "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." - } - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Bad request." - } - } - } - } - }, - "415" : { - "description" : "Unsupported media type.", - "content" : { - "application/json" : { - "schema" : { - "type" : "string", - "example" : { - "message" : "Unsupported media type." - } - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/assets/publish" : { - "post" : { - "tags" : [ - "AssetsImport", - "AssetsPublish" - ], - "summary" : "asset publish", - "description" : "This endpoint publishes assets to the Catena-X network.", - "operationId" : "publishAssets", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/RegisterAssetRequest" - } - } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No Content." - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - } - }, - "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." - }, - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "OK.", - "content" : { - "application/json" : {} - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "201" : { - "description" : "Created." - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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", - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created." - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "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", - "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" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "201" : { - "description" : "Created.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/QualityNotificationIdResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "204" : { - "description" : "No content." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the 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" - }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessageResponseList" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - } - } - } - } - }, - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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", - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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 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", - "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" - } - } - } - } - }, - "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" : { - "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", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - }, - "patch" : { - "tags" : [ - "AssetsAsBuilt" - ], - "summary" : "Updates asset", - "description" : "The endpoint updates asset by provided quality type.", - "operationId" : "updateAsset_1", - "parameters" : [ - { - "name" : "assetId", - "in" : "path", - "required" : true, - "schema" : { - "type" : "string" - } - } - ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/UpdateAssetRequest" - } - } - }, - "required" : true - }, - "responses" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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", - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "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" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns the policies", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/PolicyResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" : { - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "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" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "200" : { - "description" : "Returns dashboard data", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/DashboardResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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." - }, - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "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" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "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", - "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" - } - } - } - } - }, - "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" : 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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "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", - "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" - } - } - } - } - }, - "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" : { - "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", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "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", - "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" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "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" - } - } - } - }, - "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" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "403" : { - "description" : "Forbidden.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "security" : [ - { - "oAuth2" : [ - "profile email" - ] - } - ] - } - }, - "/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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Returns a distinct filter values for given fieldName.", - "content" : { - "application/json" : { - "schema" : { - "maxItems" : 2147483647, - "minItems" : 0, - "type" : "array", - "items" : { - "type" : "string" - } - } - } - } - }, - "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" - } - } - } - }, - "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" : { - "404" : { - "description" : "Not found.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "200" : { - "description" : "Ok." - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "400" : { - "description" : "Bad request.", - "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" - } - } - } - } - }, - "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" - } - } - } - }, - "401" : { - "description" : "Authorization failed.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "500" : { - "description" : "Internal server error.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "429" : { - "description" : "Too many requests.", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/ErrorResponse" - } - } - } - }, - "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" - } - } - } - }, - "415" : { - "description" : "Unsupported media type", - "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" - } - } - }, - "BpnEdcMappingResponse" : { - "type" : "object", - "properties" : { - "bpn" : { - "type" : "string", - "example" : "BPNL00000003CSGV" - }, - "url" : { - "type" : "string", - "example" : "https://trace-x-test-edc.dev.demo.catena-x.net/a1" - } - } - }, - "ErrorResponse" : { - "type" : "object", - "properties" : { - "message" : { - "maxLength" : 1000, - "minLength" : 0, - "pattern" : "^.*$", - "type" : "string", - "example" : "Access Denied" - } - } - }, - "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" - }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessageResponseList" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/QualityNotificationMessageResponse" - } - } - } - }, - "QualityNotificationMessageResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "createdBy" : { - "type" : "string" - }, - "createdByName" : { - "type" : "string" - }, - "sendTo" : { - "type" : "string" - }, - "sendToName" : { - "type" : "string" - }, - "edcUrl" : { - "type" : "string" - }, - "contractAgreementId" : { - "type" : "string" - }, - "notificationReferenceId" : { - "type" : "string" - }, - "targetDate" : { - "type" : "string", - "format" : "date-time" - }, - "severity" : { - "type" : "string", - "enum" : [ - "MINOR", - "MAJOR", - "CRITICAL", - "LIFE-THREATENING" - ] - }, - "edcNotificationId" : { - "type" : "string" - }, - "created" : { - "type" : "string", - "format" : "date-time" - }, - "updated" : { - "type" : "string", - "format" : "date-time" - }, - "messageId" : { - "type" : "string" - }, - "isInitial" : { - "type" : "boolean" - }, - "status" : { - "type" : "string", - "enum" : [ - "CREATED", - "SENT", - "RECEIVED", - "ACKNOWLEDGED", - "ACCEPTED", - "DECLINED", - "CANCELED", - "CLOSED" - ] - }, - "errorMessage" : { - "type" : "string" - } - } - }, - "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" - } - } - } - }, - "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" - }, - "errorMessage" : { - "maxLength" : 255, - "minLength" : 0, - "type" : "string", - "example" : "EDC not reachable" - }, - "qualityNotificationMessageResponseList" : { - "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", - "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" : "localhost", - "scopes" : { - "profile email" : "" - } - } - } - } - } - } -} +{"openapi":"3.0.1","info":{"title":"Trace-FOSS - OpenAPI Documentation","description":"Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.","license":{"name":"License: Apache 2.0"},"version":"1.0.0"},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}}}}},"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"}}}},"200":{"description":"Returns the paged result found","content":{"application/json":{}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content.","content":{"application/json":{}}},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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 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"},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"},"qualityNotificationMessageResponseList":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotificationContractResponse"}}}},"404":{"description":"Not found.","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."}}}}},"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."}}}}},"200":{"description":"Ok.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","description":"PageResults","items":{"$ref":"#/components/schemas/PageResultContractResponse"}}}}},"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."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Too many requests."}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"string","example":{"message":"Unsupported media type."}}}}}},"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"}}}},"400":{"description":"Bad request.","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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","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"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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"}}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created."},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","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"}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityNotificationIdResponse"}}}},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No content."},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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"},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"},"qualityNotificationMessageResponseList":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}}}}}},"403":{"description":"Forbidden.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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 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"}}}}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the 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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the 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"}}}}},"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"}}}},"400":{"description":"Bad request.","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"}}}},"403":{"description":"Forbidden.","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"202":{"description":"Created registry reload job."},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the policies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"404":{"description":"Not found.","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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":-2147483648,"type":"array","description":"Investigations","items":{"$ref":"#/components/schemas/InvestigationResponse"}}}}},"403":{"description":"Forbidden.","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"}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns dashboard data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}},"404":{"description":"Not found.","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":{"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"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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":{"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"}}}}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}}}},"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":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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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"}}}}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns the paged result found for Asset","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","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"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","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"}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"OK.","content":{"application/json":{"schema":{"maxItems":2147483647,"type":"array","description":"Alerts","items":{"$ref":"#/components/schemas/AlertResponse"}}}}},"403":{"description":"Forbidden.","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"}}}}},"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":{"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Returns a distinct filter values for given fieldName.","content":{"application/json":{"schema":{"maxItems":2147483647,"minItems":0,"type":"array","items":{"type":"string"}}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Ok."},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authorization failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"204":{"description":"No Content."},"404":{"description":"Not found.","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"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"200":{"description":"Okay"},"403":{"description":"Forbidden.","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":"Deleted."}},"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"},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"},"qualityNotificationMessageResponseList":{"type":"array","items":{"$ref":"#/components/schemas/QualityNotificationMessageResponse"}}}},"QualityNotificationMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"type":"string"},"sendTo":{"type":"string"},"sendToName":{"type":"string"},"edcUrl":{"type":"string"},"contractAgreementId":{"type":"string"},"notificationReferenceId":{"type":"string"},"targetDate":{"type":"string","format":"date-time"},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL","LIFE-THREATENING"]},"edcNotificationId":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","format":"date-time"},"messageId":{"type":"string"},"isInitial":{"type":"boolean"},"status":{"type":"string","enum":["CREATED","SENT","RECEIVED","ACKNOWLEDGED","ACCEPTED","DECLINED","CANCELED","CLOSED"]},"errorMessage":{"type":"string"}}},"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"}}}},"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"},"errorMessage":{"maxLength":255,"minLength":0,"type":"string","example":"EDC not reachable"},"qualityNotificationMessageResponseList":{"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":"localhost","scopes":{"profile email":""}}}}}}} \ No newline at end of file diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/base/service/AssetBaseService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/base/service/AssetBaseService.java index 1ba141dcec..f6ee033c21 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/base/service/AssetBaseService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/base/service/AssetBaseService.java @@ -19,6 +19,7 @@ package org.eclipse.tractusx.traceability.assets.application.base.service; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.domain.base.model.QualityType; import org.eclipse.tractusx.traceability.common.model.PageResult; @@ -47,4 +48,6 @@ public interface AssetBaseService { AssetBase updateQualityType(String assetId, QualityType qualityType); List getDistinctFilterValues(String fieldName, String startWith, Integer size, Owner owner); + + List getAssetIdsInImportState(ImportState... importStates); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PolicyService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PolicyService.java index c98abd8213..8e0e118135 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PolicyService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PolicyService.java @@ -24,4 +24,6 @@ public interface PolicyService { List getAllPolicies(); + + PolicyResponse getPolicyById(String id); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PublishService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PublishService.java index 27cc7b368c..93e4a69bb7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PublishService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/PublishService.java @@ -18,9 +18,13 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.assets.application.importpoc; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; + import java.util.List; public interface PublishService { - void publishAssets(String policyId, List assetIds); + void publishAssets(String policyId, List assetIds, boolean triggerSynchronizeAssets); + + void publishAssetsToCoreServices(List assets, boolean triggerSynchronizeAssets); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/rest/ImportController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/rest/ImportController.java index 0a1064cf5e..9704dafa93 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/rest/ImportController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/rest/ImportController.java @@ -33,6 +33,7 @@ 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.ws.rs.PathParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.application.importpoc.ImportService; @@ -51,6 +52,7 @@ 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.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -300,8 +302,8 @@ public ResponseEntity getImportReport(@PathVariable("impor schema = @Schema(implementation = ErrorResponse.class)))}) @PostMapping(value = "/publish", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity registerAssetsForPublishing(@RequestBody RegisterAssetRequest registerAssetRequest) { - publishService.publishAssets(registerAssetRequest.policyId(), registerAssetRequest.assetIds()); + public ResponseEntity registerAssetsForPublishing(@RequestBody RegisterAssetRequest registerAssetRequest, @RequestParam(name = "triggerSynchronizeAssets", defaultValue = "true") boolean triggerSynchronizeAssets) { + publishService.publishAssets(registerAssetRequest.policyId(), registerAssetRequest.assetIds(), triggerSynchronizeAssets); return ResponseEntity.status(HttpStatus.CREATED).build(); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java index f9fc1a7d66..5bce90ee48 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/AssetRepository.java @@ -20,6 +20,7 @@ package org.eclipse.tractusx.traceability.assets.domain.base; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import java.util.List; @@ -46,4 +47,8 @@ public interface AssetRepository { long countAssetsByOwner(Owner owner); List getFieldValues(String fieldName, String startWith, Integer resultLimit, Owner owner); + + List findByImportStateIn(ImportState... importStates); + + void updateImportStateAndNoteForAssets(ImportState importState, String importNote, List assetIds); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportNote.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportNote.java index 969e71ab18..87ba121b9d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportNote.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportNote.java @@ -24,5 +24,9 @@ public class ImportNote { public static final String PERSISTENT_NO_UPDATE = "Asset in sync with digital twin registry. Twin will not be updated."; public static final String PERSISTED = "Asset created/updated successfully in persistant state."; public static final String IN_SYNCHRONIZATION = "Twin in sync with digital twin registry. Twin will not be updated."; - + public static final String PUBLISHED_TO_CORE_SERVICES = "Assets Published to core services"; + public static final String ERROR_DTR_SHELL_CREATION_FAILED = "Failed to create shell in DTR"; + public static final String ERROR_EDC_POLICY_CREATION_FAILED = "Failed to create Policy in EDC"; + public static final String ERROR_EDC_ASSET_CREATION_FAILED = "Failed to create Asset in EDC"; + public static final String ERROR_EDC_CONTRACT_CREATION_FAILED = "Failed to create Contract in EDC"; } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportState.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportState.java index 82e83a9fd7..0d424a005a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportState.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/model/ImportState.java @@ -20,5 +20,10 @@ public enum ImportState { - TRANSIENT, PERSISTENT, ERROR, IN_SYNCHRONIZATION, UNSET + TRANSIENT, + PERSISTENT, + ERROR, + IN_SYNCHRONIZATION, + PUBLISHED_TO_CORE_SERVICES, + UNSET } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java index cf058248ca..b004fc72ad 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java @@ -126,6 +126,11 @@ public List getDistinctFilterValues(String fieldName, String startWith, return getAssetRepository().getFieldValues(fieldName, startWith, resultSize, owner); } + @Override + public List getAssetIdsInImportState(ImportState... importStates) { + return getAssetRepository().findByImportStateIn(importStates).stream().map(AssetBase::getId).toList(); + } + private boolean isSupportedEnumType(String fieldName) { return SUPPORTED_ENUM_FIELDS.contains(fieldName); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/PublishAssetsJob.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/PublishAssetsJob.java new file mode 100644 index 0000000000..608a07dab9 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/PublishAssetsJob.java @@ -0,0 +1,59 @@ +/******************************************************************************** + * 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.assets.domain.importpoc; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.traceability.assets.application.importpoc.PublishService; +import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; +import org.eclipse.tractusx.traceability.common.config.ApplicationProfiles; +import org.springframework.context.annotation.Profile; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.stream.Stream; + +@Slf4j +@Component +@EnableScheduling +@Profile(ApplicationProfiles.NOT_TESTS) +@RequiredArgsConstructor +public class PublishAssetsJob { + + private final AssetAsBuiltRepository assetAsBuiltRepository; + private final AssetAsPlannedRepository assetAsPlannedRepository; + private final PublishService publishService; + + @Scheduled(cron = "* 30 */1 * * ?", zone = "Europe/Berlin") + public void publishAssets() { + log.info("Start publish assets cron job"); + List assetsAsBuiltInSync = assetAsBuiltRepository.findByImportStateIn(ImportState.IN_SYNCHRONIZATION); + List assetsAsPlannedInSync = assetAsPlannedRepository.findByImportStateIn(ImportState.IN_SYNCHRONIZATION); + List allInSyncAssets = Stream.concat(assetsAsPlannedInSync.stream(), assetsAsBuiltInSync.stream()).toList(); + log.info("Found following assets in state IN_SYNCHRONIZATION to publish {}", allInSyncAssets.stream().map(AssetBase::getId).toList()); + boolean triggerSynchronizeAssets = true; + publishService.publishAssetsToCoreServices(allInSyncAssets, triggerSynchronizeAssets); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/exception/PolicyNotFoundException.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/exception/PolicyNotFoundException.java new file mode 100644 index 0000000000..784be7780e --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/exception/PolicyNotFoundException.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.assets.domain.importpoc.exception; + +public class PolicyNotFoundException extends RuntimeException{ + public PolicyNotFoundException(String message) { + super(message); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepository.java index 521f81660c..47782f2a1f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepository.java @@ -22,9 +22,12 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.GenericSubmodel; import java.util.List; +import java.util.Map; public interface SubmodelPayloadRepository { void savePayloadForAssetAsBuilt(String assetId, List submodels); void savePayloadForAssetAsPlanned(String assetId, List submodels); + + Map getAspectTypesAndPayloadsByAssetId(String assetId); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/AsyncPublishService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/AsyncPublishService.java new file mode 100644 index 0000000000..30e7605cfe --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/AsyncPublishService.java @@ -0,0 +1,100 @@ +/******************************************************************************** + * 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.assets.domain.importpoc.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.irs.edc.client.asset.model.exception.CreateEdcAssetException; +import org.eclipse.tractusx.irs.edc.client.contract.model.exception.CreateEdcContractDefinitionException; +import org.eclipse.tractusx.irs.edc.client.policy.model.exception.CreateEdcPolicyDefinitionException; +import org.eclipse.tractusx.irs.registryclient.decentral.exception.CreateDtrShellException; +import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportNote; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; +import org.eclipse.tractusx.traceability.common.config.AssetsAsyncConfig; +import org.eclipse.tractusx.traceability.shelldescriptor.domain.service.DecentralRegistryServiceImpl; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@Service +public class AsyncPublishService { + + private final AssetAsPlannedRepository assetAsPlannedRepository; + private final AssetAsBuiltRepository assetAsBuiltRepository; + private final EdcAssetCreationService edcAssetCreationService; + private final DtrService dtrService; + private final DecentralRegistryServiceImpl decentralRegistryService; + + @Async(value = AssetsAsyncConfig.PUBLISH_ASSETS_EXECUTOR) + public void publishAssetsToCoreServices(List assets, boolean triggerSynchronizeAssets) { + Map> assetsByPolicyId = assets.stream().collect(Collectors.groupingBy(AssetBase::getPolicyId)); + + List createdShellsAssetIds = new ArrayList<>(); + assetsByPolicyId.forEach((policyId, assetsForPolicy) -> { + String submodelServerAssetId = null; + + try { + submodelServerAssetId = edcAssetCreationService.createEdcContractDefinitionsForDtrAndSubmodel(policyId); + } catch (CreateEdcPolicyDefinitionException e) { + log.error("Failed to create EDC Policy.", e); + updateAssetStates(ImportState.ERROR, ImportNote.ERROR_EDC_POLICY_CREATION_FAILED, assetsForPolicy.stream().map(AssetBase::getId).toList()); + } catch (CreateEdcAssetException e) { + log.error("Failed to create EDC Asset.", e); + updateAssetStates(ImportState.ERROR, ImportNote.ERROR_EDC_ASSET_CREATION_FAILED, assetsForPolicy.stream().map(AssetBase::getId).toList()); + } catch (CreateEdcContractDefinitionException e) { + log.error("Failed to create EDC Contract.", e); + updateAssetStates(ImportState.ERROR, ImportNote.ERROR_EDC_CONTRACT_CREATION_FAILED, assetsForPolicy.stream().map(AssetBase::getId).toList()); + } + + if (Objects.nonNull(submodelServerAssetId)) { + String tempSubmodelServerAssetId = submodelServerAssetId; + assetsForPolicy.forEach(assetBase -> { + try { + String assetId = dtrService.createShellInDtr(assetBase, tempSubmodelServerAssetId); + createdShellsAssetIds.add(assetId); + } catch (CreateDtrShellException e) { + log.error("Failed to create shell in dtr for asset with id %s".formatted(assetBase.getId()), e); + updateAssetStates(ImportState.ERROR, ImportNote.ERROR_DTR_SHELL_CREATION_FAILED, List.of(assetBase.getId())); + } + }); + + updateAssetStates(ImportState.PUBLISHED_TO_CORE_SERVICES, ImportNote.PUBLISHED_TO_CORE_SERVICES, createdShellsAssetIds); + if (triggerSynchronizeAssets) { + decentralRegistryService.synchronizeAssets(); + } + } + }); + } + + private void updateAssetStates(ImportState importState, String importNote, List assetIds) { + assetAsBuiltRepository.updateImportStateAndNoteForAssets(importState, importNote, assetIds); + assetAsPlannedRepository.updateImportStateAndNoteForAssets(importState, importNote, assetIds); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java new file mode 100644 index 0000000000..d45c43e919 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java @@ -0,0 +1,189 @@ +/******************************************************************************** + * 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.assets.domain.importpoc.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.irs.component.assetadministrationshell.AssetAdministrationShellDescriptor; +import org.eclipse.tractusx.irs.component.assetadministrationshell.Endpoint; +import org.eclipse.tractusx.irs.component.assetadministrationshell.IdentifierKeyValuePair; +import org.eclipse.tractusx.irs.component.assetadministrationshell.ProtocolInformation; +import org.eclipse.tractusx.irs.component.assetadministrationshell.Reference; +import org.eclipse.tractusx.irs.component.assetadministrationshell.SecurityAttribute; +import org.eclipse.tractusx.irs.component.assetadministrationshell.SemanticId; +import org.eclipse.tractusx.irs.component.assetadministrationshell.SubmodelDescriptor; +import org.eclipse.tractusx.irs.registryclient.decentral.DigitalTwinRegistryCreateShellService; +import org.eclipse.tractusx.irs.registryclient.decentral.exception.CreateDtrShellException; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.importpoc.repository.SubmodelPayloadRepository; +import org.eclipse.tractusx.traceability.common.properties.EdcProperties; +import org.eclipse.tractusx.traceability.submodel.domain.repository.SubmodelServerRepository; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@Slf4j +@Service +@RequiredArgsConstructor +public class DtrService { + private static final String GLOBAL_REFERENCE = "GlobalReference"; + private static final String EXTERNAL_REFERENCE = "ExternalReference"; + + private final DigitalTwinRegistryCreateShellService dtrCreateShellService; + private final SubmodelPayloadRepository submodelPayloadRepository; + private final SubmodelServerRepository submodelServerRepository; + private final EdcProperties edcProperties; + + @Value("${registry.allowedBpns}") + String allowedBpns; + + public String createShellInDtr(final AssetBase assetBase, String submodelServerAssetId) throws CreateDtrShellException { + Map payloadByAspectType = submodelPayloadRepository.getAspectTypesAndPayloadsByAssetId(assetBase.getId()); + Map createdSubmodelIdByAspectType = payloadByAspectType.entrySet().stream() + .map(this::createSubmodel) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + + List descriptors = toSubmodelDescriptors(createdSubmodelIdByAspectType, submodelServerAssetId); + + dtrCreateShellService.createShell(aasFrom(assetBase, descriptors)); + + return assetBase.getId(); + } + + private List toSubmodelDescriptors(Map createdSubmodelIdByAspectType, String submodelServerAssetId) { + return createdSubmodelIdByAspectType.entrySet() + .stream().map(entry -> + toSubmodelDescriptor(entry.getKey(), entry.getValue(), submodelServerAssetId) + + ).toList(); + } + + private SubmodelDescriptor toSubmodelDescriptor(String aspectType, UUID submodelServerIdReference, String submodelServerAssetId) { + return SubmodelDescriptor.builder() + .description(List.of()) + .idShort(aspectTypeToSimpleSubmodelName(aspectType)) + .id(submodelServerIdReference.toString()) + .semanticId( + Reference.builder() + .type(EXTERNAL_REFERENCE) + .keys( + List.of(SemanticId.builder() + .type(GLOBAL_REFERENCE) + .value(aspectType).build()) + ).build() + ) + .endpoints( + List.of( + Endpoint.builder() + .interfaceInformation("SUBMODEL-3.0") + .protocolInformation( + ProtocolInformation.builder() + .href(edcProperties.getProviderDataplaneEdcUrl() + "/api/public/data/" + submodelServerIdReference) + .endpointProtocol("HTTP") + .endpointProtocolVersion(List.of("1.1")) + .subprotocol("DSP") + .subprotocolBodyEncoding("plain") + .subprotocolBody(getSubProtocol(submodelServerAssetId)) + .securityAttributes( + List.of(SecurityAttribute.none()) + ).build() + ).build() + ) + ).build(); + } + + private String getSubProtocol(String submodelServerAssetId) { + final String edcProviderControlplaneUrl = edcProperties.getProviderEdcUrl(); + return "id=%s;dspEndpoint=%s".formatted(submodelServerAssetId, edcProviderControlplaneUrl); + } + + private String aspectTypeToSimpleSubmodelName(String aspectType) { + String[] split = aspectType.split("#"); + return split[1]; + } + + private Map.Entry createSubmodel(Map.Entry payloadByAspectType) { + UUID submodelId = UUID.randomUUID(); + submodelServerRepository.saveSubmodel(submodelId.toString(), payloadByAspectType.getValue()); + log.info("create submodelId {} for aspectType {} on submodelServer", submodelId, payloadByAspectType.getKey()); + return Map.entry(payloadByAspectType.getKey(), submodelId); + } + + private AssetAdministrationShellDescriptor aasFrom(AssetBase assetBase, List descriptors) { + return AssetAdministrationShellDescriptor.builder() + .globalAssetId(assetBase.getId()) + .idShort(assetBase.getIdShort()) + .id(UUID.randomUUID().toString()) + .specificAssetIds(aasIdentifiersFromAsset(assetBase)) + .submodelDescriptors(descriptors) + .build(); + } + + List aasIdentifiersFromAsset(AssetBase assetBase) { + return List.of( + IdentifierKeyValuePair.builder() + .name("manufacturerId") + .value(assetBase.getManufacturerId()) + .externalSubjectId( + Reference.builder() + .type(EXTERNAL_REFERENCE) + .keys(getExternalSubjectIds()) + .build()) + .build(), + IdentifierKeyValuePair.builder() + .name("manufacturerPartId") + .value(assetBase.getManufacturerPartId()) + .externalSubjectId( + Reference.builder() + .type(EXTERNAL_REFERENCE) + .keys(getExternalSubjectIds()) + .build()) + .build() + ); + } + + private List getExternalSubjectIds() { + List externalSubjectIds = List.of(SemanticId.builder() + .type(GLOBAL_REFERENCE) + .value("PUBLIC_READABLE") + .build()); + List configurationExternalSubjectIds = getAllowedBpns().stream() + .map(allowedBpn -> + SemanticId.builder() + .type(GLOBAL_REFERENCE) + .value(allowedBpn) + .build() + ) + .toList(); + + return Stream.concat(externalSubjectIds.stream(), configurationExternalSubjectIds.stream()).toList(); + } + + // TODO: Issue #740 will handle and decide how to avoid having allowed bpns in config ( should be managed by policy to access data ) needs investigation + public List getAllowedBpns() { + return Arrays.stream(allowedBpns.split(",")).toList(); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/EdcAssetCreationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/EdcAssetCreationService.java new file mode 100644 index 0000000000..be715d1a3c --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/EdcAssetCreationService.java @@ -0,0 +1,151 @@ +/******************************************************************************** + * 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.assets.domain.importpoc.service; + +import assets.importpoc.ConstraintResponse; +import assets.importpoc.ConstraintsResponse; +import assets.importpoc.PermissionResponse; +import assets.importpoc.PolicyResponse; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.irs.edc.client.asset.EdcAssetService; +import org.eclipse.tractusx.irs.edc.client.asset.model.OdrlContext; +import org.eclipse.tractusx.irs.edc.client.asset.model.exception.CreateEdcAssetException; +import org.eclipse.tractusx.irs.edc.client.asset.model.exception.EdcAssetAlreadyExistsException; +import org.eclipse.tractusx.irs.edc.client.contract.model.EdcOperator; +import org.eclipse.tractusx.irs.edc.client.contract.model.exception.CreateEdcContractDefinitionException; +import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractDefinitionService; +import org.eclipse.tractusx.irs.edc.client.policy.model.EdcCreatePolicyDefinitionRequest; +import org.eclipse.tractusx.irs.edc.client.policy.model.EdcPolicy; +import org.eclipse.tractusx.irs.edc.client.policy.model.EdcPolicyPermission; +import org.eclipse.tractusx.irs.edc.client.policy.model.EdcPolicyPermissionConstraint; +import org.eclipse.tractusx.irs.edc.client.policy.model.EdcPolicyPermissionConstraintExpression; +import org.eclipse.tractusx.irs.edc.client.policy.model.exception.CreateEdcPolicyDefinitionException; +import org.eclipse.tractusx.irs.edc.client.policy.model.exception.EdcPolicyDefinitionAlreadyExists; +import org.eclipse.tractusx.irs.edc.client.policy.service.EdcPolicyDefinitionService; +import org.eclipse.tractusx.traceability.assets.application.importpoc.PolicyService; +import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.UUID; + +@Slf4j +@Service +@RequiredArgsConstructor +public class EdcAssetCreationService { + private static final String REGISTRY_ASSET_ID = "registry-asset"; + private final EdcAssetService edcAssetService; + private final EdcPolicyDefinitionService edcPolicyDefinitionService; + private final EdcContractDefinitionService edcContractDefinitionService; + private final TraceabilityProperties traceabilityProperties; + private final PolicyService policyService; + @Value("${registry.urlWithPath}") + String registryUrlWithPath = null; + + public String createEdcContractDefinitionsForDtrAndSubmodel(String policyId) throws CreateEdcPolicyDefinitionException, CreateEdcAssetException, CreateEdcContractDefinitionException { + PolicyResponse policy = policyService.getPolicyById(policyId); + String createdPolicyId; + try { + createdPolicyId = edcPolicyDefinitionService.createAccessPolicy(mapToEdcPolicyRequest(policy)); + log.info("DTR Policy Id created :{}", createdPolicyId); + } catch (EdcPolicyDefinitionAlreadyExists e) { + createdPolicyId = policyId; + } catch (Exception exception) { + throw new CreateEdcPolicyDefinitionException(exception); + } + + String dtrAssetId; + try { + dtrAssetId = edcAssetService.createDtrAsset(registryUrlWithPath, REGISTRY_ASSET_ID); + log.info("DTR Asset Id created :{}", dtrAssetId); + } catch (EdcAssetAlreadyExistsException e) { + dtrAssetId = REGISTRY_ASSET_ID; + } catch (Exception exception) { + throw new CreateEdcAssetException(exception); + } + + try { + String dtrContractId = edcContractDefinitionService.createContractDefinition(dtrAssetId, createdPolicyId); + log.info("DTR Contract Id created :{}", dtrContractId); + } catch (Exception e) { + throw new CreateEdcContractDefinitionException(e); + } + + String submodelAssetId; + String submodelAssetIdToCreate = "urn:uuid:" + UUID.randomUUID(); + try { + submodelAssetId = edcAssetService.createSubmodelAsset(traceabilityProperties.getSubmodelBase() + "/api/submodel", submodelAssetIdToCreate); + log.info("Submodel Asset Id created :{}", submodelAssetId); + } catch (EdcAssetAlreadyExistsException e) { + submodelAssetId = submodelAssetIdToCreate; + } catch (Exception exception) { + throw new CreateEdcAssetException(exception); + } + + try { + String submodelContractId = edcContractDefinitionService.createContractDefinition(submodelAssetId, createdPolicyId); + log.info("Submodel Contract Id created :{}", submodelContractId); + } catch (Exception e) { + throw new CreateEdcContractDefinitionException(e); + } + + return submodelAssetId; + } + + private EdcCreatePolicyDefinitionRequest mapToEdcPolicyRequest(PolicyResponse policy) { + OdrlContext odrlContext = OdrlContext.builder().odrl("http://www.w3.org/ns/odrl/2/").build(); + EdcPolicy edcPolicy = EdcPolicy.builder().odrlPermissions(mapToPermissions(policy.permissions())).type("Policy").build(); + return EdcCreatePolicyDefinitionRequest.builder() + .policyDefinitionId(policy.policyId()) + .policy(edcPolicy) + .odrlContext(odrlContext) + .type("PolicyDefinitionRequestDto") + .build(); + } + + private List mapToPermissions(List permissions) { + return permissions.stream().map(permission -> EdcPolicyPermission.builder() + .action(permission.action().name()) + .edcPolicyPermissionConstraints(mapToConstraint(permission.constraints())) + .build() + ).toList(); + } + + private EdcPolicyPermissionConstraint mapToConstraint(ConstraintsResponse constraintsResponse) { + return EdcPolicyPermissionConstraint.builder() + .type("AtomicConstraint") + .orExpressions(mapToConstraintExpression(constraintsResponse.or())) + .build(); + } + + private List mapToConstraintExpression(List constraints) { + return constraints.stream().map(constraint -> EdcPolicyPermissionConstraintExpression.builder() + .type("Constraint") + .leftOperand(constraint.leftOperand()) + .rightOperand(constraint.rightOperand()) + .operator(EdcOperator.builder() + .operatorId("odrl:" + constraint.operatorTypeResponse().getCode()) + .build()) + .build()) + .toList(); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PolicyServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PolicyServiceImpl.java index 7da4c6ac39..17d1113b3c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PolicyServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PolicyServiceImpl.java @@ -23,12 +23,14 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.application.importpoc.PolicyService; import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; +import org.eclipse.tractusx.traceability.assets.domain.importpoc.exception.PolicyNotFoundException; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.IrsPolicyResponse; +import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; -import java.util.Collections; import java.util.List; -import java.util.Optional; + +import static org.apache.commons.collections4.ListUtils.emptyIfNull; @Slf4j @RequiredArgsConstructor @@ -36,11 +38,22 @@ public class PolicyServiceImpl implements PolicyService { private final IrsRepository irsRepository; + @Override public List getAllPolicies() { - List allPolicies = Optional.ofNullable(irsRepository.getPolicies()) - .orElse(Collections.emptyList()); + return IrsPolicyResponse.toResponse(getAcceptedPoliciesOrEmptyList()); + } + + @Override + public PolicyResponse getPolicyById(String id) { + return getAcceptedPoliciesOrEmptyList().stream() + .filter(policy -> policy.payload().policy().getPolicyId().equals(id)).findFirst() + .map(IrsPolicyResponse::toResponse) + .orElseThrow(() -> new PolicyNotFoundException("Policy with id: %s not found.".formatted(id))); + } - return IrsPolicyResponse.toResponse(allPolicies); + @NotNull + private List getAcceptedPoliciesOrEmptyList() { + return emptyIfNull(irsRepository.getPolicies()); } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PublishServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PublishServiceImpl.java index e9e02f1405..5834e24552 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PublishServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/PublishServiceImpl.java @@ -29,9 +29,14 @@ import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.importpoc.exception.PublishAssetException; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState.ERROR; +import static org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState.TRANSIENT; @Slf4j @@ -41,28 +46,40 @@ public class PublishServiceImpl implements PublishService { private final AssetAsPlannedRepository assetAsPlannedRepository; private final AssetAsBuiltRepository assetAsBuiltRepository; + private final AsyncPublishService asyncPublishService; @Override - public void publishAssets(String policyId, List assetIds) { - //Update assets with policy id + @Transactional + public void publishAssets(String policyId, List assetIds, boolean triggerSynchronizeAssets) { assetIds.forEach(this::throwIfNotExists); + //Update assets with policy id log.info("Updating status of asPlannedAssets."); - updateAssetWithStatusAndPolicy(policyId, assetIds, assetAsPlannedRepository); + List updatedAsPlannedAssets = updateAssetWithStatusAndPolicy(policyId, assetIds, assetAsPlannedRepository); log.info("Updating status of asBuiltAssets."); - updateAssetWithStatusAndPolicy(policyId, assetIds, assetAsBuiltRepository); + List updatedAsBuiltAssets = updateAssetWithStatusAndPolicy(policyId, assetIds, assetAsBuiltRepository); + + publishAssetsToCoreServices( + Stream.concat(updatedAsPlannedAssets.stream(), updatedAsBuiltAssets.stream()).toList(), + triggerSynchronizeAssets + ); + } + + @Override + public void publishAssetsToCoreServices(List assets, boolean triggerSynchronizeAssets) { + asyncPublishService.publishAssetsToCoreServices(assets, triggerSynchronizeAssets); } + private void throwIfNotExists(String assetId) { if (!(assetAsBuiltRepository.existsById(assetId) || assetAsPlannedRepository.existsById(assetId))) { throw new PublishAssetException("No asset found with the provided ID: " + assetId); } } - - private void updateAssetWithStatusAndPolicy(String policyId, List assetIds, AssetRepository repository) { + private List updateAssetWithStatusAndPolicy(String policyId, List assetIds, AssetRepository repository) { List assetList = repository.getAssetsById(assetIds); List saveList = assetList.stream() - .filter(this::validTransientState) + .filter(this::validTransientOrErrorState) .map(asset -> { asset.setImportState(ImportState.IN_SYNCHRONIZATION); asset.setImportNote(ImportNote.IN_SYNCHRONIZATION); @@ -73,13 +90,13 @@ private void updateAssetWithStatusAndPolicy(String policyId, List assetI List assetBases = repository.saveAll(saveList); log.info("Successfully set {} in status IN_SYNCHRONIZATION", assetBases.stream().map(AssetBase::getId).collect(Collectors.joining(", "))); + return assetBases; } - private boolean validTransientState(AssetBase assetBase) { - if (ImportState.TRANSIENT.equals(assetBase.getImportState())) { + private boolean validTransientOrErrorState(AssetBase assetBase) { + if (TRANSIENT.equals(assetBase.getImportState()) || ERROR.equals(assetBase.getImportState())) { return true; } throw new PublishAssetException("Asset with ID " + assetBase.getId() + " is not in TRANSIENT state."); } - } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java index abd6841d3b..a7853ef62e 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/AssetAsBuiltRepositoryImpl.java @@ -109,7 +109,7 @@ public List saveAll(List assets) { @Override @Transactional public List saveAllIfNotInIRSSyncAndUpdateImportStateAndNote(List assets) { - if(Objects.isNull(assets)) { + if (Objects.isNull(assets)) { return List.of(); } List toPersist = assets.stream().map(assetToPersist -> new AbstractMap.SimpleEntry(assetToPersist, jpaAssetAsBuiltRepository.findById(assetToPersist.getId()).orElse(null))) @@ -132,6 +132,23 @@ private boolean entityIsTransientOrNotExistent(AbstractMap.SimpleEntry findByImportStateIn(ImportState... importStates) { + return jpaAssetAsBuiltRepository.findByImportStateIn(importStates).stream() + .map(AssetAsBuiltEntity::toDomain).toList(); + } + + @Override + public void updateImportStateAndNoteForAssets(ImportState importState, String importNote, List assetIds) { + List assets = jpaAssetAsBuiltRepository.findByIdIn(assetIds); + assets.forEach(assetAsBuilt -> { + assetAsBuilt.setImportState(importState); + assetAsBuilt.setImportNote(importNote); + }); + jpaAssetAsBuiltRepository.saveAll(assets); + } + @Override public Optional findById(String assetId) { return jpaAssetAsBuiltRepository.findById(assetId) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java index 6d592c574f..37be95412b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asbuilt/repository/JpaAssetAsBuiltRepository.java @@ -21,6 +21,7 @@ package org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; import org.springframework.data.jpa.repository.JpaRepository; @@ -37,4 +38,6 @@ public interface JpaAssetAsBuiltRepository extends JpaRepository findByImportStateIn(ImportState... importState); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java index 0fa9fd260d..9ec86732ce 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/AssetAsPlannedRepositoryImpl.java @@ -109,7 +109,7 @@ public List saveAll(List assets) { @Override @Transactional public List saveAllIfNotInIRSSyncAndUpdateImportStateAndNote(List assets) { - if(Objects.isNull(assets)) { + if (Objects.isNull(assets)) { return List.of(); } List toPersist = assets.stream().map(assetToPersist -> @@ -157,4 +157,21 @@ public long countAssetsByOwner(Owner owner) { public List getFieldValues(String fieldName, String startWith, Integer resultLimit, Owner owner) { return CriteriaUtility.getDistinctAssetFieldValues(fieldName, startWith, resultLimit, owner, AssetAsPlannedEntity.class, entityManager); } + + @Transactional + @Override + public List findByImportStateIn(ImportState... importStates) { + return jpaAssetAsPlannedRepository.findByImportStateIn(importStates).stream() + .map(AssetAsPlannedEntity::toDomain).toList(); + } + + @Override + public void updateImportStateAndNoteForAssets(ImportState importState, String importNote, List assetIds) { + List foundAssets = jpaAssetAsPlannedRepository.findByIdIn(assetIds); + foundAssets.forEach(assetAsPlanned -> { + assetAsPlanned.setImportState(importState); + assetAsPlanned.setImportNote(importNote); + }); + jpaAssetAsPlannedRepository.saveAll(foundAssets); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java index bcbfcfa074..0b27472848 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/asplanned/repository/JpaAssetAsPlannedRepository.java @@ -18,6 +18,7 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.repository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.model.AssetAsPlannedEntity; import org.springframework.data.jpa.repository.JpaRepository; @@ -32,4 +33,6 @@ public interface JpaAssetAsPlannedRepository extends JpaRepository findByImportStateIn(ImportState... importState); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java index 57f983bf2e..4e62e4a92f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsClient.java @@ -34,6 +34,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.Payload; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.jetbrains.annotations.Nullable; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; @@ -56,7 +57,8 @@ public class IrsClient { private final TraceabilityProperties traceabilityProperties; - private static final String POLICY_PATH = "/irs/policies"; + @Value("${traceability.irsPoliciesPath}") + String policiesPath = null; public IrsClient(RestTemplate irsAdminTemplate, RestTemplate irsRegularTemplate, @@ -67,12 +69,12 @@ public IrsClient(RestTemplate irsAdminTemplate, } public List getPolicies() { - return irsAdminTemplate.exchange(POLICY_PATH, HttpMethod.GET, null, new ParameterizedTypeReference>() { + return irsAdminTemplate.exchange(policiesPath, HttpMethod.GET, null, new ParameterizedTypeReference>() { }).getBody(); } public void deletePolicy() { - irsAdminTemplate.exchange(POLICY_PATH + "/" + traceabilityProperties.getRightOperand(), HttpMethod.DELETE, null, new ParameterizedTypeReference<>() { + irsAdminTemplate.exchange(policiesPath + "/" + traceabilityProperties.getRightOperand(), HttpMethod.DELETE, null, new ParameterizedTypeReference<>() { }); } @@ -97,7 +99,7 @@ public void registerPolicy() { Payload payload = new Payload(context, policyId, policy); RegisterPolicyRequest registerPolicyRequest = new RegisterPolicyRequest(validUntil.toInstant(), payload); - irsAdminTemplate.exchange(POLICY_PATH, HttpMethod.POST, new HttpEntity<>(registerPolicyRequest), Void.class); + irsAdminTemplate.exchange(policiesPath, HttpMethod.POST, new HttpEntity<>(registerPolicyRequest), Void.class); } public void registerJob(RegisterJobRequest registerJobRequest) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsRepositoryImpl.java index 5fde7a5553..5e9ebc2891 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/IrsRepositoryImpl.java @@ -25,6 +25,7 @@ import org.eclipse.tractusx.irs.edc.client.policy.Constraints; import org.eclipse.tractusx.traceability.assets.domain.base.IrsRepository; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.BomLifecycle; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.request.RegisterJobRequest; @@ -134,6 +135,7 @@ void saveOrUpdateAssets(AssetCallbackRepository repository, AssetBase asset) { existingAsset.setParentRelations(asset.getParentRelations()); } existingAsset.setTombstone(asset.getTombstone() == null ? "" : asset.getTombstone()); + existingAsset.setImportState(ImportState.PERSISTENT); repository.save(existingAsset); } else { repository.save(asset); diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/IrsPolicyResponse.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/IrsPolicyResponse.java index baa28d2082..0f2b9e60a4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/IrsPolicyResponse.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/IrsPolicyResponse.java @@ -83,13 +83,16 @@ public record IrsPolicyResponse(OffsetDateTime validUntil, Payload payload) { """; public static List toResponse(List allPolicies) { + return allPolicies.stream().map(IrsPolicyResponse::toResponse).toList(); + } - return allPolicies.stream().map(pol -> PolicyResponse.builder() - .policyId(pol.payload().policyId()) - .validUntil(pol.payload().policy().getValidUntil()) - .createdOn(pol.payload().policy().getCreatedOn()) - .permissions(map(pol.payload().policy())) - .build()).toList(); + public static PolicyResponse toResponse(IrsPolicyResponse policy) { + return PolicyResponse.builder() + .policyId(policy.payload().policyId()) + .validUntil(policy.payload().policy().getValidUntil()) + .createdOn(policy.payload().policy().getCreatedOn()) + .permissions(map(policy.payload().policy())) + .build(); } private static List map(Policy policy) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java index 9238e4a8be..121c4c0c75 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/mapping/submodel/MapperHelper.java @@ -33,12 +33,19 @@ public static Owner getOwner(AssetBase assetBase, IRSResponse irsResponse) { } public static String getShortId(List shells, String globalAssetId) { - return getShortIds(shells).get(globalAssetId); + return shells.stream() + .filter(shell -> shell.payload().idShort() != null) + .map(shell -> Map.entry(shell.payload().globalAssetId(), shell.payload().idShort())) + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (existingValue, newValue) -> existingValue + )).get(globalAssetId); } public static String getContractAgreementId(List shells, String globalAssetId) { return shells.stream() - .filter(shell -> shell.payload().globalAssetId().equals(globalAssetId)) + .filter(shell -> globalAssetId.equals(shell.payload().globalAssetId())) .map(Shell::contractAgreementId) .findFirst() .orElse(null); @@ -57,16 +64,6 @@ public static OffsetDateTime getOffsetDateTime(String date) { } } - private static Map getShortIds(List shells) { - return shells.stream() - .map(shell -> Map.entry(shell.payload().globalAssetId(), shell.payload().idShort())) - .collect(Collectors.toMap( - Map.Entry::getKey, - Map.Entry::getValue, - (existingValue, newValue) -> existingValue - )); - } - public static void enrichAssetBase(List detailAspectModels, AssetBase assetBase) { detailAspectModels.stream() .filter(detailAspectModel -> detailAspectModel.getGlobalAssetId().equals(assetBase.getId())) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ApplicationConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ApplicationConfig.java index 7419216d63..364f33316b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ApplicationConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/ApplicationConfig.java @@ -29,11 +29,6 @@ import io.github.resilience4j.retry.Retry; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.eclipse.tractusx.irs.edc.client.EdcConfiguration; -import org.eclipse.tractusx.irs.edc.client.asset.EdcAssetService; -import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractDefinitionService; -import org.eclipse.tractusx.irs.edc.client.policy.service.EdcPolicyDefinitionService; -import org.eclipse.tractusx.irs.edc.client.transformer.EdcTransformer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; @@ -45,7 +40,6 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor; -import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.thymeleaf.spring6.SpringTemplateEngine; @@ -64,7 +58,6 @@ @EnableJpaRepositories(basePackages = "org.eclipse.tractusx.traceability.*") public class ApplicationConfig { - @Bean public InternalResourceViewResolver defaultViewResolver() { return new InternalResourceViewResolver(); @@ -110,7 +103,6 @@ public ITemplateResolver textTemplateResolver() { } - @Bean public RegistryEventConsumer myRetryRegistryEventConsumer() { final Logger logger = LoggerFactory.getLogger("RetryLogger"); @@ -131,19 +123,4 @@ public void onEntryRemovedEvent(EntryRemovedEvent entryRemoveEvent) { } }; } - - @Bean - public EdcAssetService edcNotificationAssetService(EdcConfiguration edcConfiguration, EdcTransformer edcTransformer, RestTemplate edcNotificationAssetRestTemplate) { - return new EdcAssetService(edcTransformer, edcConfiguration, edcNotificationAssetRestTemplate); - } - - @Bean - public EdcPolicyDefinitionService edcPolicyDefinitionService(EdcConfiguration edcConfiguration, RestTemplate edcNotificationAssetRestTemplate) { - return new EdcPolicyDefinitionService(edcConfiguration, edcNotificationAssetRestTemplate); - } - - @Bean - public EdcContractDefinitionService edcContractDefinitionService(EdcConfiguration edcConfiguration, RestTemplate edcNotificationAssetRestTemplate) { - return new EdcContractDefinitionService(edcConfiguration, edcNotificationAssetRestTemplate); - } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/AssetsAsyncConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/AssetsAsyncConfig.java index 6cda52de84..7280534a8c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/AssetsAsyncConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/AssetsAsyncConfig.java @@ -28,9 +28,20 @@ @Configuration public class AssetsAsyncConfig { - public static final String SYNCHRONIZE_ASSETS_EXECUTOR = "synchronize-assets-executor"; - public static final String LOAD_SHELL_DESCRIPTORS_EXECUTOR = "load-shell-descriptors-executor"; - public static final String UPDATE_NOTIFICATION_EXECUTOR = "update-notification-executor"; + public static final String SYNCHRONIZE_ASSETS_EXECUTOR = "synchronizeAssetsExecutor"; + public static final String LOAD_SHELL_DESCRIPTORS_EXECUTOR = "loadShellDescriptorsExecutor"; + public static final String UPDATE_NOTIFICATION_EXECUTOR = "updateNotificationExecutor"; + + public static final String PUBLISH_ASSETS_EXECUTOR = "publishAssetsExecutor"; + + @Bean(name = PUBLISH_ASSETS_EXECUTOR) + public ThreadPoolTaskExecutor publishAssetsExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(10); + executor.setMaxPoolSize(100); + executor.setThreadNamePrefix("%s-".formatted(PUBLISH_ASSETS_EXECUTOR)); + return executor; + } @Bean(name = SYNCHRONIZE_ASSETS_EXECUTOR) public ThreadPoolTaskExecutor synchronizeAssetsExecutor() { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java new file mode 100644 index 0000000000..0b57d477a8 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/EdcConfiguration.java @@ -0,0 +1,73 @@ +/******************************************************************************** + * 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.common.config; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.irs.edc.client.asset.EdcAssetService; +import org.eclipse.tractusx.irs.edc.client.contract.service.EdcContractDefinitionService; +import org.eclipse.tractusx.irs.edc.client.policy.service.EdcPolicyDefinitionService; +import org.eclipse.tractusx.irs.edc.client.transformer.EdcTransformer; +import org.eclipse.tractusx.irs.registryclient.decentral.DigitalTwinRegistryCreateShellService; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +@Configuration +@ConfigurationPropertiesScan(basePackages = "org.eclipse.tractusx.traceability.*") +@EnableWebMvc +@EnableAsync(proxyTargetClass = true) +@EnableConfigurationProperties +@RequiredArgsConstructor +@Slf4j +@EnableJpaRepositories(basePackages = "org.eclipse.tractusx.traceability.*") +public class EdcConfiguration { + + @Value("${registry.urlWithPath}") + String registryUrlWithPath; + @Value("${registry.shellDescriptorUrl}") + String shellDescriptorUrl; + + @Bean + public EdcAssetService edcAssetService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, EdcTransformer edcTransformer, RestTemplate edcDtrAssetRestTemplate) { + return new EdcAssetService(edcTransformer, edcConfiguration, edcDtrAssetRestTemplate); + } + + @Bean + public EdcPolicyDefinitionService edcPolicyDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, RestTemplate edcDtrAssetRestTemplate) { + return new EdcPolicyDefinitionService(edcConfiguration, edcDtrAssetRestTemplate); + } + + @Bean + public EdcContractDefinitionService edcContractDefinitionService(org.eclipse.tractusx.irs.edc.client.EdcConfiguration edcConfiguration, RestTemplate edcDtrAssetRestTemplate) { + return new EdcContractDefinitionService(edcConfiguration, edcDtrAssetRestTemplate); + } + + @Bean + public DigitalTwinRegistryCreateShellService dtrCreateShellService(RestTemplate digitalTwinRegistryCreateShellRestTemplate) { + return new DigitalTwinRegistryCreateShellService(digitalTwinRegistryCreateShellRestTemplate, registryUrlWithPath + shellDescriptorUrl); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java index bb2a67d1d5..87df042bca 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/RestTemplateConfiguration.java @@ -73,7 +73,7 @@ public RestTemplate edcRestTemplate(@Autowired EdcProperties edcProperties) { } @Bean - public RestTemplate edcNotificationAssetRestTemplate(@Autowired EdcProperties edcProperties) { + public RestTemplate edcDtrAssetRestTemplate(@Autowired EdcProperties edcProperties) { return new RestTemplateBuilder() .rootUri(edcProperties.getProviderEdcUrl()) .defaultHeader("Accept", MediaType.APPLICATION_JSON_VALUE) @@ -84,6 +84,12 @@ public RestTemplate edcNotificationAssetRestTemplate(@Autowired EdcProperties ed .build(); } + @Bean + public RestTemplate digitalTwinRegistryCreateShellRestTemplate() { + return new RestTemplateBuilder() + .build(); + } + /* RestTemplate used by trace x for the notification transfer to the edc controlplane including edc api key*/ @Bean public RestTemplate edcNotificationTemplate(@Autowired EdcProperties edcProperties) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java index e722c9248d..3af860511f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/properties/EdcProperties.java @@ -51,6 +51,10 @@ public class EdcProperties { @Value("${edc.provider-edc-url}") private String providerEdcUrl; + @NotBlank + @Value("${edc.provider-dataplane-edc-url}") + private String providerDataplaneEdcUrl; + @NotBlank @Value("${edc.api-auth-key}") private String apiAuthKey; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/contract/EdcNotificationContractService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/contract/EdcNotificationContractService.java index b9f17c9c4f..7453f1fdd7 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/contract/EdcNotificationContractService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/contract/EdcNotificationContractService.java @@ -43,7 +43,7 @@ @AllArgsConstructor public class EdcNotificationContractService { - private final EdcAssetService edcNotificationAssetService; + private final EdcAssetService edcAssetService; private final EdcPolicyDefinitionService edcPolicyDefinitionService; private final EdcContractDefinitionService edcContractDefinitionService; private final TraceabilityProperties traceabilityProperties; @@ -60,7 +60,7 @@ public CreateNotificationContractResponse handle(CreateNotificationContractReque String notificationAssetId; try { - notificationAssetId = edcNotificationAssetService.createNotificationAsset( + notificationAssetId = edcAssetService.createNotificationAsset( createBaseUrl(request.notificationType(), request.notificationMethod()), request.notificationType().name() + " " + request.notificationMethod().name(), org.eclipse.tractusx.irs.edc.client.asset.model.NotificationMethod.valueOf(request.notificationMethod().name()), @@ -115,7 +115,7 @@ private void revertNotificationAsset(String notificationAssetId) { log.info("Removing {} notification asset", notificationAssetId); try { - edcNotificationAssetService.deleteAsset(notificationAssetId); + edcAssetService.deleteAsset(notificationAssetId); } catch (DeleteEdcAssetException e) { throw new CreateNotificationContractException(e); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/shelldescriptor/domain/service/DecentralRegistryServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/shelldescriptor/domain/service/DecentralRegistryServiceImpl.java index 7e216ab4f2..74223180a9 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/shelldescriptor/domain/service/DecentralRegistryServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/shelldescriptor/domain/service/DecentralRegistryServiceImpl.java @@ -27,6 +27,7 @@ import org.eclipse.tractusx.irs.component.assetadministrationshell.AssetAdministrationShellDescriptor; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.service.AssetAsBuiltServiceImpl; import org.eclipse.tractusx.traceability.assets.domain.asplanned.service.AssetAsPlannedServiceImpl; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; import org.eclipse.tractusx.traceability.common.config.AssetsAsyncConfig; import org.eclipse.tractusx.traceability.common.properties.TraceabilityProperties; import org.eclipse.tractusx.traceability.shelldescriptor.application.DecentralRegistryService; @@ -34,7 +35,6 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import java.util.Collection; import java.util.List; import static org.eclipse.tractusx.traceability.assets.domain.base.model.SemanticDataModel.BATCH; @@ -58,12 +58,18 @@ public class DecentralRegistryServiceImpl implements DecentralRegistryService { @Override @Async(value = AssetsAsyncConfig.LOAD_SHELL_DESCRIPTORS_EXECUTOR) public void synchronizeAssets() { - Collection shellDescriptors = decentralRegistryRepository.retrieveShellDescriptorsByBpn(traceabilityProperties.getBpn().toString()); - Collection asBuiltShellDescriptors = shellDescriptors.stream().map(Shell::payload).filter(this::isAsBuilt).toList(); - Collection asPlannedShellDescriptors = shellDescriptors.stream().map(Shell::payload).filter(this::isAsPlanned).toList(); + List shellDescriptors = decentralRegistryRepository.retrieveShellDescriptorsByBpn(traceabilityProperties.getBpn().toString()); + List asBuiltAssetIds = shellDescriptors.stream().map(Shell::payload).filter(this::isAsBuilt).map(AssetAdministrationShellDescriptor::getGlobalAssetId).toList(); + List asPlannedAssetIds = shellDescriptors.stream().map(Shell::payload).filter(this::isAsPlanned).map(AssetAdministrationShellDescriptor::getGlobalAssetId).toList(); - asBuiltShellDescriptors.forEach(shellDescriptor -> assetAsBuiltService.synchronizeAssetsAsync(shellDescriptor.getGlobalAssetId())); - asPlannedShellDescriptors.forEach(shellDescriptor -> assetAsPlannedService.synchronizeAssetsAsync(shellDescriptor.getGlobalAssetId())); + List existingAsBuiltInSyncAndTransientStates = assetAsBuiltService.getAssetIdsInImportState(ImportState.TRANSIENT, ImportState.IN_SYNCHRONIZATION); + List existingAsPlannedInSyncAndTransientStates = assetAsPlannedService.getAssetIdsInImportState(ImportState.TRANSIENT, ImportState.IN_SYNCHRONIZATION); + + List asBuiltAssetsToSync = asBuiltAssetIds.stream().filter(assetId -> !existingAsBuiltInSyncAndTransientStates.contains(assetId)).toList(); + List asPlannedAssetsToSync = asPlannedAssetIds.stream().filter(assetId -> !existingAsPlannedInSyncAndTransientStates.contains(assetId)).toList(); + + asBuiltAssetsToSync.forEach(assetAsBuiltService::synchronizeAssetsAsync); + asPlannedAssetsToSync.forEach(assetAsPlannedService::synchronizeAssetsAsync); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/model/SubmodelPayloadEntity.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/model/SubmodelPayloadEntity.java index 916e9d90e4..4a520fc885 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/model/SubmodelPayloadEntity.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/model/SubmodelPayloadEntity.java @@ -18,7 +18,6 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.submodel.infrastructure.model; -import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.GeneratedValue; @@ -54,12 +53,12 @@ public class SubmodelPayloadEntity { private String json; - @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "asset_as_built_id") @ToString.Exclude public AssetAsBuiltEntity assetAsBuilt; - @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "asset_as_planned_id") @ToString.Exclude private AssetAsPlannedEntity assetAsPlanned; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/JpaSubmodelPayloadRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/JpaSubmodelPayloadRepository.java index 3c61739a22..38dec7549f 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/JpaSubmodelPayloadRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/JpaSubmodelPayloadRepository.java @@ -19,9 +19,17 @@ package org.eclipse.tractusx.traceability.submodel.infrastructure.repository; +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.submodel.infrastructure.model.SubmodelPayloadEntity; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface JpaSubmodelPayloadRepository extends JpaRepository { + List findByAssetAsBuilt(AssetAsBuiltEntity assetAsBuilt); + + List findByAssetAsPlanned(AssetAsPlannedEntity assetAsPlanned); + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelPayloadRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelPayloadRepositoryImpl.java index 440ddf812b..ff06d9460b 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelPayloadRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/submodel/infrastructure/repository/SubmodelPayloadRepositoryImpl.java @@ -31,6 +31,9 @@ import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; @Repository @RequiredArgsConstructor @@ -52,4 +55,22 @@ public void savePayloadForAssetAsPlanned(String assetId, List s AssetAsPlannedEntity asset = jpaAssetAsPlannedRepository.findById(assetId).orElseThrow(() -> new AssetNotFoundException(ASSET_NOT_FOUND_EXCEPTION_TEMPLATE.formatted(assetId))); jpaSubmodelPayloadRepository.saveAll(SubmodelPayloadEntity.from(asset, submodels)); } + + @Override + public Map getAspectTypesAndPayloadsByAssetId(String assetId) { + Optional assetAsBuilt = jpaAssetAsBuiltRepository.findById(assetId); + Optional assetAsPlanned = jpaAssetAsPlannedRepository.findById(assetId); + + if(assetAsBuilt.isPresent()) { + return toTypesAndPayloadsMap(jpaSubmodelPayloadRepository.findByAssetAsBuilt(assetAsBuilt.get())); + } else if (assetAsPlanned.isPresent()) { + return toTypesAndPayloadsMap(jpaSubmodelPayloadRepository.findByAssetAsPlanned(assetAsPlanned.get())); + } + throw new AssetNotFoundException(ASSET_NOT_FOUND_EXCEPTION_TEMPLATE.formatted(assetId)); + } + + private Map toTypesAndPayloadsMap(List entities) { + return entities.stream().map(entity -> Map.entry(entity.getAspectType(), entity.getJson())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } } diff --git a/tx-backend/src/main/resources/application-integration-spring-boot.yml b/tx-backend/src/main/resources/application-integration-spring-boot.yml index 0c7a0fbfa9..0e89b7222b 100644 --- a/tx-backend/src/main/resources/application-integration-spring-boot.yml +++ b/tx-backend/src/main/resources/application-integration-spring-boot.yml @@ -29,10 +29,14 @@ traceability: adminApiKey: testAdminKey regularApiKey: testRegularKey irsBase: "http://127.0.0.1" - submodelBase: "http://127.0.0.1" + submodelBase: http://localhost:${server.port} +registry: + urlWithPath: "http://127.0.0.1" edc: api-auth-key: "integration-tests" + provider-edc-url: "http://127.0.0.1" + provider-dataplane-edc-url: "http://127.0.0.1" spring: security: diff --git a/tx-backend/src/main/resources/application.yml b/tx-backend/src/main/resources/application.yml index de6c30a377..fadf74af7b 100644 --- a/tx-backend/src/main/resources/application.yml +++ b/tx-backend/src/main/resources/application.yml @@ -28,6 +28,7 @@ traceability: adminApiKey: ${IRS_ADMIN_API_KEY} regularApiKey: ${IRS_REGULAR_API_KEY} irsBase: ${IRS_URL} + irsPoliciesPath: "/irs/policies" submodelBase: ${SUBMODEL_URL} edc: @@ -47,6 +48,8 @@ edc: api-auth-key: ${EDC_API_KEY} bpn-provider-url-mappings: { } provider-edc-url: ${EDC_PROVIDER_URL} + provider-dataplane-edc-url: ${EDC_PROVIDER_DATAPLANE_URL} + callback-urls: ${EDC_CALLBACK_URL} irs-edc-client: @@ -155,6 +158,11 @@ cors: ${ALLOWED_CORS_ORIGIN_FIRST}, ${ALLOWED_CORS_ORIGIN_SECOND} +registry: + urlWithPath: ${REGISTRY_URL_WITH_PATH:https://registry.net/semantics/registry/api/v3.0} + shellDescriptorUrl: /shell-descriptors + allowedBpns: ${REGISTRY_ALLOWED_BPNS:BPNL00000003CML1,BPNL00000003CNKC} + digitalTwinRegistryClient: shellDescriptorTemplate: /shell-descriptors/{aasIdentifier} # The path to retrieve AAS descriptors from the decentral DTR, must contain the placeholder {aasIdentifier} lookupShellsTemplate: /lookup/shells?assetIds={assetIds} # The path to lookup shells from the decentral DTR, must contain the placeholder {assetIds} diff --git a/tx-backend/src/main/resources/db/migration/V17__set_30_chars_for_import_state.sql b/tx-backend/src/main/resources/db/migration/V17__set_30_chars_for_import_state.sql new file mode 100644 index 0000000000..54b34b434c --- /dev/null +++ b/tx-backend/src/main/resources/db/migration/V17__set_30_chars_for_import_state.sql @@ -0,0 +1,2 @@ +ALTER TABLE assets_as_planned ALTER COLUMN import_state TYPE VARCHAR (30); +ALTER TABLE assets_as_built ALTER COLUMN import_state TYPE VARCHAR(30); diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepositoryIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepositoryIT.java new file mode 100644 index 0000000000..e2c85aed9e --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/repository/SubmodelPayloadRepositoryIT.java @@ -0,0 +1,71 @@ +package org.eclipse.tractusx.traceability.assets.domain.importpoc.repository; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.eclipse.tractusx.traceability.assets.domain.importpoc.model.ImportRequest; +import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.GenericSubmodel; +import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static org.assertj.core.api.Assertions.assertThat; + +class SubmodelPayloadRepositoryIT extends IntegrationTestSpecification { + + @Autowired + JpaAssetAsBuiltRepository assetAsBuiltRepository; + @Autowired + AssetsSupport assetsSupport; + + @Autowired + SubmodelPayloadRepository submodelPayloadRepository; + @Autowired + JpaAssetAsBuiltRepository jpaAssetAsBuiltRepository; + + ObjectMapper objectMapper; + + @BeforeEach + @Transactional + void setUp() { + objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + } + + @Test + void givenAssetAsBuilt_when() throws IOException { + // given + String filePath = "src/test/resources/testdata/import-request.json"; + + String jsonString = Files.readString(Path.of(filePath)); + String assetId = "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb"; + ImportRequest importRequest = objectMapper.readValue(jsonString, ImportRequest.class); + List submodels = importRequest.assets().stream() + .filter(asset -> Objects.equals(asset.assetMetaInfoRequest().catenaXId(), assetId)).findFirst() + .map(ImportRequest.AssetImportRequest::submodels).get(); + + + assetsSupport.defaultAssetsStored(); + jpaAssetAsBuiltRepository.findAll(); + submodelPayloadRepository.savePayloadForAssetAsBuilt(assetId, submodels); + importRequest.assets().stream().map(it -> it.assetMetaInfoRequest().catenaXId()).toList(); + + + // when + Map result = submodelPayloadRepository.getAspectTypesAndPayloadsByAssetId(assetId); + + // then + assertThat(result).isNotNull(); + } + +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java index 48e1ad4f93..e9a6102de2 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/notificationcontract/service/EdcNotificationContractServiceTest.java @@ -106,7 +106,7 @@ void testHandle() throws CreateEdcAssetException, CreateEdcPolicyDefinitionExcep } @Test - void givenService_whenAssetCreationThrowsException_thenThrowException() throws CreateEdcAssetException, CreateEdcPolicyDefinitionException, CreateEdcContractDefinitionException { + void givenService_whenAssetCreationThrowsException_thenThrowException() throws CreateEdcAssetException { // given NotificationType notificationType = NotificationType.QUALITY_INVESTIGATION; NotificationMethod notificationMethod = NotificationMethod.RESOLVE; diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilterValuesIT.java index fd99996bf1..7c08f27a59 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilterValuesIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerFilterValuesIT.java @@ -275,7 +275,7 @@ void givenEnumTypeFieldNameImportState_whenCallDistinctFilterValues_thenProperRe .log().all() .statusCode(200) .assertThat() - .body("size()", is(5)); + .body("size()", is(6)); } private static Stream fieldNameTestProvider() { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerFilterValuesIT.java index fcad08c2ce..06a935961b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerFilterValuesIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsPlannedControllerFilterValuesIT.java @@ -218,6 +218,7 @@ void givenNotEnumTypeFieldNameAndSizeAndOwnerSupplier_whenCallDistinctFilterValu .assertThat() .body("size()", is(1)); } + @Test void givenEnumTypeFieldNameImportState_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { // given @@ -240,7 +241,7 @@ void givenEnumTypeFieldNameImportState_whenCallDistinctFilterValues_thenProperRe .log().all() .statusCode(200) .assertThat() - .body("size()", is(5)); + .body("size()", is(6)); } private static Stream fieldNameTestProvider() { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/asbuilt/infrastructure/repository/AssetAsBuiltRepositoryIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/asbuilt/infrastructure/repository/AssetAsBuiltRepositoryIT.java index 3bb1d759bc..50d1e54f3e 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/asbuilt/infrastructure/repository/AssetAsBuiltRepositoryIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/asbuilt/infrastructure/repository/AssetAsBuiltRepositoryIT.java @@ -20,8 +20,13 @@ package org.eclipse.tractusx.traceability.integration.assets.asbuilt.infrastructure.repository; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltRepository; +import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; +import org.eclipse.tractusx.traceability.assets.domain.base.model.ImportState; +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.AssetsSupport; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -40,6 +45,9 @@ class AssetAsBuiltRepositoryIT extends IntegrationTestSpecification { @Autowired AssetsSupport assetsSupport; + @Autowired + JpaAssetAsBuiltRepository jpaAssetAsBuiltRepository; + @ParameterizedTest @MethodSource("fieldNameTestProvider") void givenIdField_whenGetFieldValues_thenSorted( @@ -60,6 +68,23 @@ void givenIdField_whenGetFieldValues_thenSorted( .hasSize(expectedSize); } + @Test + void givenAssets_whenGetByImportStateIn_thenReturnProperAssets() { + // given + assetsSupport.defaultAssetsStored(); + AssetAsBuiltEntity entityInSyncState = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").get(); + entityInSyncState.setImportState(ImportState.IN_SYNCHRONIZATION); + AssetAsBuiltEntity entityTransientState = jpaAssetAsBuiltRepository.findById("urn:uuid:6dafbcec-2fce-4cbb-a5a9-b3b32aa5cffc").get(); + entityTransientState.setImportState(ImportState.TRANSIENT); + jpaAssetAsBuiltRepository.saveAll(List.of(entityInSyncState, entityTransientState)); + + // when + List result = assetAsBuiltRepository.findByImportStateIn(ImportState.TRANSIENT, ImportState.IN_SYNCHRONIZATION); + + // then + assertThat(result).hasSize(2); + } + private static Stream fieldNameTestProvider() { return Stream.of( Arguments.of("id", "urn:uuid:1", 10, 3), diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java index cdee80d0f2..aca244feb3 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java @@ -58,8 +58,10 @@ public void initialize(ConfigurableApplicationContext configurableApplicationCon "feign.registryApi.url=http://127.0.0.1:" + STUB_SERVER_PORT, "feign.registryApi.defaultBpn=BPNL00000003AYRE", "edc.provider-edc-url=http://localhost:" + STUB_SERVER_PORT, - "edc.callbackUrls=http://localhost:" + STUB_SERVER_PORT + "/callback/redirect", - "irs-edc-client.controlplane.endpoint.data=http://localhost:" + STUB_SERVER_PORT + "/management" + "irs-edc-client.controlplane.endpoint.data=http://localhost:" + STUB_SERVER_PORT + "/management", + "registry.urlWithPath=http://127.0.0.1:" + STUB_SERVER_PORT + "/semantics/registry/api/v3.0", + "edc.parts-provider-edc-controlplane-url=http://localhost:" + STUB_SERVER_PORT, + "edc.callbackUrls=http://localhost:" + STUB_SERVER_PORT + "/callback/redirect" ).applyTo(configurableApplicationContext.getEnvironment()); } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DtrApiSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DtrApiSupport.java new file mode 100644 index 0000000000..7a740a62af --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DtrApiSupport.java @@ -0,0 +1,59 @@ +/******************************************************************************** + * 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 org.glassfish.grizzly.http.util.HttpStatus; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import static com.xebialabs.restito.builder.stub.StubHttp.whenHttp; +import static com.xebialabs.restito.builder.verify.VerifyHttp.verifyHttp; +import static com.xebialabs.restito.semantics.Action.status; +import static com.xebialabs.restito.semantics.Condition.post; + +@Component +public class DtrApiSupport { + + @Autowired + RestitoProvider restitoProvider; + + public void dtrWillCreateShell() { + whenHttp(restitoProvider.stubServer()).match( + post("/semantics/registry/api/v3.0/shell-descriptors") + ).then( + status(HttpStatus.CREATED_201) + ); + } + + public void dtrWillFailToCreateShell() { + whenHttp(restitoProvider.stubServer()).match( + post("/semantics/registry/api/v3.0/shell-descriptors") + ).then( + status(HttpStatus.SERVICE_UNAVAILABLE_503) + ); + } + + public void verifyDtrCreateShellCalledTimes(int times) { + verifyHttp(restitoProvider.stubServer()).times( + times, + post("/semantics/registry/api/v3.0/shell-descriptors") + ); + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java index 54ca206f4f..90b91a52d5 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/EdcSupport.java @@ -55,6 +55,24 @@ public void edcWillCreateNotificationAsset() { ); } + public void edcWillCreateAsset() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v3/assets"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.OK_200) + ); + } + + public void edcWillFailToCreateAsset() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v3/assets"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.SERVICE_UNAVAILABLE_503) + ); + } + public void edcWillRemoveNotificationAsset() { whenHttp(restitoProvider.stubServer()).match( method(DELETE), @@ -134,6 +152,15 @@ public void edcWillCreatePolicyDefinition() { ); } + public void edcWillReturnConflictWhenCreatePolicyDefinition() { + whenHttp(restitoProvider.stubServer()).match( + post("/management/v2/policydefinitions"), + EDC_API_KEY_HEADER + ).then( + status(HttpStatus.CONFLICT_409) + ); + } + public void edcWillRemovePolicyDefinition() { whenHttp(restitoProvider.stubServer()).match( composite( @@ -151,7 +178,7 @@ public void edcWillFailToCreatePolicyDefinition() { post("/management/v2/policydefinitions"), EDC_API_KEY_HEADER ).then( - status(HttpStatus.INTERNAL_SERVER_ERROR_500) + status(HttpStatus.SERVICE_UNAVAILABLE_503) ); } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/OAuth2ApiSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/OAuth2ApiSupport.java index bcc1b51794..48a8268012 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/OAuth2ApiSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/OAuth2ApiSupport.java @@ -46,6 +46,17 @@ public void oauth2ApiReturnsTechnicalUserToken() { ); } + public void oauth2ApiReturnsDtrToken() { + whenHttp(restitoProvider.stubServer()).match( + post(RestitoConfig.OAUTH2_TOKEN_PATH) + ) + .then( + ok(), + header("Content-Type", "application/json"), + restitoProvider.jsonResponseFromFile("./stubs/oauth/post/auth/realms/CX-Central/protocol/openid-connect/token/response_200.json") + ); + } + public void oauth2ApiReturnsJwkCerts(String jwk) { whenHttp(restitoProvider.stubServer()).match( get(RestitoConfig.OAUTH2_JWK_PATH) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/importdata/ImportControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/importdata/ImportControllerIT.java index eb48a114db..5f7bc24497 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/importdata/ImportControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/importdata/ImportControllerIT.java @@ -36,9 +36,13 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.repository.JpaAssetAsPlannedRepository; import org.eclipse.tractusx.traceability.common.security.JwtRole; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.DtrApiSupport; +import org.eclipse.tractusx.traceability.integration.common.support.EdcSupport; +import org.eclipse.tractusx.traceability.integration.common.support.IrsApiSupport; import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; +import org.opentest4j.AssertionFailedError; import org.springframework.beans.factory.annotation.Autowired; import java.io.File; @@ -60,6 +64,15 @@ class ImportControllerIT extends IntegrationTestSpecification { @Autowired JpaAssetAsPlannedRepository jpaAssetAsPlannedRepository; + @Autowired + EdcSupport edcApiSupport; + + @Autowired + DtrApiSupport dtrApiSupport; + + @Autowired + IrsApiSupport irsApiSupport; + @Test void givenValidFile_whenImportData_thenValidationShouldPass() throws JoseException { // given @@ -381,7 +394,52 @@ void givenInvalidAspect_whenImportData_thenValidationShouldNotPass() throws Jose } @Test - void givenValidFile_whenPublishData_thenStatusShouldChangeToInSynchronization() throws JoseException { + void givenValidFile_whenPublishData_thenStatusShouldChangeToInPublishedToCX() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish?triggerSynchronizeAssets=false") + .then() + .statusCode(201); + + // then + eventually(() -> { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getPolicyId()).isEqualTo("default-policy"); + assertThat(asset.getImportState()).isEqualTo(ImportState.PUBLISHED_TO_CORE_SERVICES); + dtrApiSupport.verifyDtrCreateShellCalledTimes(1); + return true; + }); + + } + + @Test + void givenValidFile2_whenPublishData_thenStatusShouldChangeToPublishedToCx() throws JoseException, InterruptedException { // given String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); File file = new File(path); @@ -395,7 +453,14 @@ void givenValidFile_whenPublishData_thenStatusShouldChangeToInSynchronization() .statusCode(200) .extract().as(ImportResponse.class); - RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("Trace-X policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillReturnConflictWhenCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); // when given() @@ -407,15 +472,252 @@ void givenValidFile_whenPublishData_thenStatusShouldChangeToInSynchronization() .then() .statusCode(201); - //then - AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); - assertThat("Trace-X policy").isEqualTo(asset.getPolicyId()); - assertThat(ImportState.IN_SYNCHRONIZATION).isEqualTo(asset.getImportState()); + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getPolicyId()).isEqualTo("default-policy"); + assertThat(asset.getImportState()).isEqualTo(ImportState.PUBLISHED_TO_CORE_SERVICES); + dtrApiSupport.verifyDtrCreateShellCalledTimes(1); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); + } + + @Test + void givenValidFile_whenPublishDataFailsOnDtr_thenStatusShouldChangeError() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillReturnConflictWhenCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillFailToCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish") + .then() + .statusCode(201); + + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getImportState()).isEqualTo(ImportState.ERROR); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); + } + + @Test + void givenValidFile_whenPublishDataFailsOnPolicy_thenStatusShouldChangeError() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillFailToCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish") + .then() + .statusCode(201); + + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getImportState()).isEqualTo(ImportState.ERROR); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); + } + + @Test + void givenValidFile_whenPublishDataFailsOnEdcPolicyCreation_thenStatusShouldChangeError() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillFailToCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish") + .then() + .statusCode(201); + + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getImportState()).isEqualTo(ImportState.ERROR); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); + } + + @Test + void givenValidFile_whenPublishDataFailsOnEdcAssetCreation_thenStatusShouldChangeError() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillCreatePolicyDefinition(); + edcApiSupport.edcWillFailToCreateAsset(); + edcApiSupport.edcWillCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish") + .then() + .statusCode(201); + + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getImportState()).isEqualTo(ImportState.ERROR); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); + } + + @Test + void givenValidFile_whenPublishDataFailsOnEdcContractCreation_thenStatusShouldChangeError() throws JoseException, InterruptedException { + // given + String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); + File file = new File(path); + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .when() + .multiPart(file) + .post("/api/assets/import") + .then() + .statusCode(200) + .extract().as(ImportResponse.class); + + RegisterAssetRequest registerAssetRequest = new RegisterAssetRequest("default-policy", List.of("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f")); + irsApiSupport.irsApiReturnsPolicies(); + edcApiSupport.edcWillCreatePolicyDefinition(); + edcApiSupport.edcWillCreateAsset(); + edcApiSupport.edcWillFailToCreateContractDefinition(); + oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken(); + oAuth2ApiSupport.oauth2ApiReturnsDtrToken(); + dtrApiSupport.dtrWillCreateShell(); + + // when + given() + .header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN)) + .contentType(ContentType.JSON) + .when() + .body(registerAssetRequest) + .post("/api/assets/publish") + .then() + .statusCode(201); + + // then + eventually(() -> { + try { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertThat(asset.getImportState()).isEqualTo(ImportState.ERROR); + } catch (AssertionFailedError exception) { + return false; + } + return true; + }); } @Test - void givenInvalidAssetID_whenPublishData_thenStatusCode404() throws JoseException { + void givenInvalidAssetID_whenPublishData_thenStatusCode404() throws JoseException, InterruptedException { // given String path = getClass().getResource("/testdata/importfiles/validImportFile.json").getFile(); File file = new File(path); @@ -443,9 +745,13 @@ void givenInvalidAssetID_whenPublishData_thenStatusCode404() throws JoseExceptio .statusCode(404); //then - AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); - assertNull(asset.getPolicyId()); - assertEquals(asset.getImportState(), ImportState.TRANSIENT); + eventually(() -> { + AssetBase asset = assetAsBuiltRepository.getAssetById("urn:uuid:254604ab-2153-45fb-8cad-54ef09f4080f"); + assertNull(asset.getPolicyId()); + assertEquals(ImportState.TRANSIENT, asset.getImportState()); + return true; + }); + } @Test diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/policy/PolicyControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/policy/PolicyControllerIT.java index fd2c0c3a19..3c824e5e50 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/policy/PolicyControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/policy/PolicyControllerIT.java @@ -27,6 +27,8 @@ import static io.restassured.RestAssured.given; import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; class PolicyControllerIT extends IntegrationTestSpecification { @Autowired @@ -45,6 +47,7 @@ void shouldReturnPolicy() throws JoseException { .get("/api/policies") .then() .statusCode(200) + .body("size()", is(1)) .log().all(); } diff --git a/tx-backend/src/test/resources/testdata/import-request.json b/tx-backend/src/test/resources/testdata/import-request.json index 579f9a98f3..62711da288 100644 --- a/tx-backend/src/test/resources/testdata/import-request.json +++ b/tx-backend/src/test/resources/testdata/import-request.json @@ -2,7 +2,7 @@ "assets" : [ { "assetMetaInfo" : { - "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd" + "catenaXId" : "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb" }, "submodels" : [ { @@ -26,7 +26,7 @@ "date" : "2018-09-28T04:15:57.000Z", "country" : "DEU" }, - "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", + "catenaXId" : "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb", "partTypeInformation" : { "manufacturerPartId" : "22782277-50", "customerPartId" : "22782277-50", @@ -39,7 +39,7 @@ { "aspectType" : "urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt", "payload" : { - "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", + "catenaXId" : "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb", "childItems" : [ { "quantity" : { @@ -58,7 +58,7 @@ { "aspectType" : "urn:bamm:io.catenax.single_level_usage_as_built:2.0.0#SingleLevelUsageAsBuilt", "payload" : { - "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", + "catenaXId" : "urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb", "customers" : [ { "parentItems" : [ diff --git a/tx-models/src/main/java/assets/importpoc/OperatorTypeResponse.java b/tx-models/src/main/java/assets/importpoc/OperatorTypeResponse.java index d1a4d66bd3..eb360f9ac5 100644 --- a/tx-models/src/main/java/assets/importpoc/OperatorTypeResponse.java +++ b/tx-models/src/main/java/assets/importpoc/OperatorTypeResponse.java @@ -21,11 +21,13 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Getter; @JsonSerialize( using = ToStringSerializer.class ) +@Getter public enum OperatorTypeResponse { EQ("eq", "Equals to"), diff --git a/tx-models/src/main/java/assets/response/base/response/ImportStateResponse.java b/tx-models/src/main/java/assets/response/base/response/ImportStateResponse.java index a84b2580c4..8be7b9d0ab 100644 --- a/tx-models/src/main/java/assets/response/base/response/ImportStateResponse.java +++ b/tx-models/src/main/java/assets/response/base/response/ImportStateResponse.java @@ -22,6 +22,5 @@ @ApiModel public enum ImportStateResponse { - TRANSIENT, PERSISTENT, ERROR, IN_SYNCHRONIZATION, UNSET; - + TRANSIENT, PERSISTENT, ERROR, IN_SYNCHRONIZATION, PUBLISHED_TO_CORE_SERVICES, UNSET }