diff --git a/CHANGELOG.md b/CHANGELOG.md index 10bff8b305..448b515eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Added implementation for cucumber tests for quality investigations - Separation of auto complete mechanism (selected / searched elements) - Added new step definition for cucumber tests "I use assets with ids {string}" allowing to specify assets used for notification creation +- Added autocomplete endpoints for notifications - Added BPN column to parts table - Emit change check to observables in frontend @@ -29,29 +30,37 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Cucumber test steps for creating notifications no longer support default assetId when no asset is provided with previous step - Upgraded the Upload_Testdata job in Argo Workflow to fix bugs - Auto format for frontend source code applied +- Updated user-manual for Parts filtering autocomplete functionality +- Fixed issue when requesting autocomplete api endpoints with no size provided - Default pagination size to 50. - Split up bpn column in notification table views to show bpn and name separately - Changed detailed part view action from clicking on list item to a menu action column - +- Changed FE fieldName mapping to fix bug for properties catenaxSiteId and function +- Fix of global search field +- Parts autocomplete API now is case insensitive when using "startWith" parameter ### Removed - removed asset filters ( qualityInvestigationIdsInStatusActive, qualityInvestigationIdsInStatusActive ) - Removed Cucumber tests steps for creating alerts with two parts as new step definition is enough for the same feature -## [9.0.0-rc4 - xx.xx.2023] -### Added -- Added new dashboard layout and additional widgets -- Refactored dashboard response -- Added new fields to dashboard response +## [9.0.0 - 05.12.2023] +### Changed +- Upgraded irs-client library from 1.4.1-SNAPSHOT to 1.4.1 + +### Known knowns + +- Backend/Frontend [TRACEFOSS-2728]: Investigations / Alerts: Transition of the message status will take some time. If it fails the user will not be informed. ## [9.0.0-rc3 - 27.11.2023] ### Added - DEPENDENCIES_FRONTEND, SECURITY.md, NOTICE.md, LICENSE file to frontend docker image - Added a step-by-step guide to register a server in pgAdmin in the database dump README - Documentation about technical users +- Added new dashboard layout and additional widgets ### Changed - Fixed helm repository path for backend & frontend (wrong prefix) +- Refactored dashboard response - Updated user manual - Autocomplete endpoints changed owner String type param to Owner for input validation and sql injection prevention - Autocomplete endpoints repository uses now criteria api rather than native query diff --git a/docs/src/docs/user/user-manual.adoc b/docs/src/docs/user/user-manual.adoc index 9c38c9e63d..cd080662c6 100644 --- a/docs/src/docs/user/user-manual.adoc +++ b/docs/src/docs/user/user-manual.adoc @@ -113,6 +113,10 @@ Alternatively, you can use the view toggle to adjust the visibility of the table Both tables can be sorted, filtered and searched. The global search bar at the top returns part results from both Tables. +Choosing filter input field for column and typing in any character will show filter suggestions that can be used for search functionality that starts with given characters or phrase. + +image::https://raw.githubusercontent.com/eclipse-tractusx/traceability-foss/main/docs/src/images/user-manual/parts-autosuggestion-filtering.png[] + === AsBuilt Lifecycle Parts List view of own Parts with AsBuilt Lifecycle. diff --git a/docs/src/images/user-manual/parts-autosuggestion-filtering.png b/docs/src/images/user-manual/parts-autosuggestion-filtering.png new file mode 100644 index 0000000000..ff6bd86ce4 Binary files /dev/null and b/docs/src/images/user-manual/parts-autosuggestion-filtering.png differ diff --git a/frontend/src/app/modules/shared/assembler/parts.assembler.ts b/frontend/src/app/modules/shared/assembler/parts.assembler.ts index 40d170620a..b1b19f47dc 100644 --- a/frontend/src/app/modules/shared/assembler/parts.assembler.ts +++ b/frontend/src/app/modules/shared/assembler/parts.assembler.ts @@ -238,42 +238,54 @@ export class PartsAssembler { }); } + public static mapFieldNameToApi(fieldName: string) { + if (!fieldName) { + return; + } + + if(this.localToApiMapping.has(fieldName)) { + return this.localToApiMapping.get(fieldName); + } else { + return fieldName; + } + + } + public static mapSortToApiSort(sorting: TableHeaderSort): string { if (!sorting) { return ''; } - - const localToApiMapping = new Map([ - [ 'id', 'id' ], - [ 'idShort', 'idShort' ], - [ 'semanticModelId', 'semanticModelId' ], - [ 'manufacturer', 'manufacturerName' ], - [ 'manufacturerPartId', 'manufacturerPartId' ], - [ 'partId', 'manufacturerPartId' ], - [ 'nameAtManufacturer', 'nameAtManufacturer' ], - [ 'businessPartner', 'businessPartner' ], - [ 'name', 'nameAtManufacturer' ], - [ 'qualityType', 'qualityType' ], - [ 'van', 'van' ], - [ 'semanticDataModel', 'semanticDataModel' ], - [ 'classification', 'classification' ], - [ 'customerPartId', 'customerPartId' ], - [ 'nameAtCustomer', 'nameAtCustomer' ], - [ 'manufacturingDate', 'manufacturingDate' ], - [ 'manufacturingCountry', 'manufacturingCountry' ], - [ 'validityPeriodFrom', 'validityPeriodFrom' ], - [ 'validityPeriodTo', 'validityPeriodTo' ], - [ 'catenaXSiteId', 'catenaXSiteId' ], - [ 'psFunction', 'function' ], - [ 'functionValidFrom', 'functionValidFrom' ], - [ 'functionValidUntil', 'functionValidUntil' ], - [ 'sentActiveAlerts', 'sentQualityAlertIdsInStatusActive' ], - [ 'receivedActiveAlerts', 'receivedQualityAlertIdsInStatusActive' ], - [ 'sentActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], - [ 'receivedActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], - ]); - - return `${ localToApiMapping.get(sorting[0]) || sorting },${ sorting[1] }`; + return `${ this.localToApiMapping.get(sorting[0]) || sorting },${ sorting[1] }`; } + + public static localToApiMapping = new Map([ + [ 'id', 'id' ], + [ 'idShort', 'idShort' ], + [ 'semanticModelId', 'semanticModelId' ], + [ 'manufacturer', 'manufacturerName' ], + [ 'manufacturerPartId', 'manufacturerPartId' ], + [ 'partId', 'manufacturerPartId' ], + [ 'nameAtManufacturer', 'nameAtManufacturer' ], + [ 'businessPartner', 'businessPartner' ], + [ 'name', 'nameAtManufacturer' ], + [ 'qualityType', 'qualityType' ], + [ 'van', 'van' ], + [ 'semanticDataModel', 'semanticDataModel' ], + [ 'classification', 'classification' ], + [ 'customerPartId', 'customerPartId' ], + [ 'nameAtCustomer', 'nameAtCustomer' ], + [ 'manufacturingDate', 'manufacturingDate' ], + [ 'manufacturingCountry', 'manufacturingCountry' ], + [ 'validityPeriodFrom', 'validityPeriodFrom' ], + [ 'validityPeriodTo', 'validityPeriodTo' ], + [ 'catenaXSiteId', 'catenaxSiteId' ], + [ 'psFunction', 'function' ], + [ 'functionValidFrom', 'functionValidFrom' ], + [ 'functionValidUntil', 'functionValidUntil' ], + [ 'sentActiveAlerts', 'sentQualityAlertIdsInStatusActive' ], + [ 'receivedActiveAlerts', 'receivedQualityAlertIdsInStatusActive' ], + [ 'sentActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], + [ 'receivedActiveInvestigations', 'receivedQualityAlertIdsInStatusActive' ], + ]); } diff --git a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts index 491618d04e..cba8b2f2eb 100644 --- a/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts +++ b/frontend/src/app/modules/shared/components/multi-select-autocomplete/multi-select-autocomplete.component.ts @@ -24,14 +24,12 @@ import { Component, EventEmitter, Inject, Input, LOCALE_ID, OnChanges, ViewChild import { FormControl } from '@angular/forms'; import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core'; import { MatDatepickerInputEvent } from '@angular/material/datepicker'; +import { MatSelectChange } from '@angular/material/select'; import { Owner } from '@page/parts/model/owner.enum'; import { PartTableType } from '@shared/components/table/table.model'; -import { - FormatPartSemanticDataModelToCamelCasePipe, -} from '@shared/pipes/format-part-semantic-data-model-to-camelcase.pipe'; +import { FormatPartSemanticDataModelToCamelCasePipe } from '@shared/pipes/format-part-semantic-data-model-to-camelcase.pipe'; import { PartsService } from '@shared/service/parts.service'; import { firstValueFrom } from 'rxjs'; -import { MatSelectChange } from '@angular/material/select'; @Component({ selector: 'app-multiselect', @@ -299,18 +297,17 @@ export class MultiSelectAutocompleteComponent implements OnChanges { if (this.singleSearch) { return; } - // TODO the issue is that the selectedValue is already empty but still needs to be readded to the options if unselected + if (!this.allOptions) { + this.allOptions = []; + } this.options = this.allOptions.filter(option => !this.selectedValue.includes(option.value)); if (!this.selectedValue) { this.options = this.allOptions; } - - console.log('search options after update', this.searchedOptions); - console.log('options after update', this.options); - - console.log(this.allOptions, 'all options in change'); - + if (!this.searchedOptions) { + this.searchedOptions = []; + } const filter = this.searchedOptions.filter(val => this.selectedValue.includes(val)); for (const selected of this.selectedValue) { filter.push({ display: selected, value: selected }); diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html index 4f35cac357..532121c322 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.html @@ -219,7 +219,7 @@

{{ 'table.noResultFound' | i18n }}

- + {{element[column]?.length}} diff --git a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.scss b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.scss index 533a16526f..dae3791a61 100644 --- a/frontend/src/app/modules/shared/components/parts-table/parts-table.component.scss +++ b/frontend/src/app/modules/shared/components/parts-table/parts-table.component.scss @@ -56,7 +56,7 @@ table { } .mat-mdc-row .mat-mdc-cell { - cursor: pointer; + cursor: default; } .table--no-data { @@ -86,6 +86,7 @@ table { .table--notification--cell { display: flex; align-items: center; + cursor: default; } .table--notification--cell--content { @@ -132,16 +133,16 @@ table { } tr.highlighted { - @apply bg-warning bg-opacity-30; + background-color: #ffe581; &:hover { - @apply bg-warning bg-opacity-30; + background-color: #ffe271; } } tr.error { - @apply bg-danger bg-opacity-20; + background-color: #ff878c; &:hover { - @apply bg-danger bg-opacity-20; + background-color: #ff5960; } } @@ -161,7 +162,6 @@ tr.error { } .table--menu { - background-color: white; &__mobile { display: none; @@ -178,6 +178,20 @@ tr.error { } } +.table--menu.highlighted { + background-color: #ffe581; + &:hover { + background-color: #ffe271; + } +} + +.table--menu.error { + background-color: #ff878c; + &:hover { + background-color: #ff5960; + } +} + .expand-row { height: 0; } @@ -243,3 +257,7 @@ tr.error { width: 90px; } +.table--notification--cell--notification--count { + cursor: pointer; +} + diff --git a/frontend/src/app/modules/shared/service/parts.service.ts b/frontend/src/app/modules/shared/service/parts.service.ts index 996929a8d0..6ef7141ab4 100644 --- a/frontend/src/app/modules/shared/service/parts.service.ts +++ b/frontend/src/app/modules/shared/service/parts.service.ts @@ -126,8 +126,9 @@ export class PartsService { } public getDistinctFilterValues(isAsBuilt: boolean, owner: Owner, fieldNames: string, startsWith: string) { + const mappedFieldName = PartsAssembler.mapFieldNameToApi(fieldNames); let params = new HttpParams() - .set('fieldName', fieldNames) + .set('fieldName', mappedFieldName) .set('startWith', startsWith) .set('size', 200) .set('owner', owner); diff --git a/frontend/src/theme/base.scss b/frontend/src/theme/base.scss index 27afb25eda..f4adae7bbd 100644 --- a/frontend/src/theme/base.scss +++ b/frontend/src/theme/base.scss @@ -249,7 +249,8 @@ app-parts, app-other-parts, app-notifications-tab { } .mat-mdc-row:hover { - background-color: rgba(0, 0, 0, 0.04) !important; + transition: 0.1s ease !important; + filter: brightness(0.9) !important; border: none !important; } diff --git a/tx-backend/openapi/traceability-foss-backend.json b/tx-backend/openapi/traceability-foss-backend.json index 3daa1aeb5f..1e79f0ff37 100644 --- a/tx-backend/openapi/traceability-foss-backend.json +++ b/tx-backend/openapi/traceability-foss-backend.json @@ -1,2590 +1,2590 @@ { - "openapi": "3.0.1", - "info": { - "title": "Trace-FOSS - OpenAPI Documentation", - "description": "Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.", - "license": { - "name": "License: Apache 2.0" + "openapi" : "3.0.1", + "info" : { + "title" : "Trace-FOSS - OpenAPI Documentation", + "description" : "Trace-FOSS is a system for tracking parts along the supply chain. A high level of transparency across the supplier network enables faster intervention based on a recorded event in the supply chain. This saves costs by seamlessly tracking parts and creates trust through clearly defined and secure data access by the companies and persons involved in the process.", + "license" : { + "name" : "License: Apache 2.0" }, - "version": "1.0.0" + "version" : "1.0.0" }, - "servers": [ + "servers" : [ { - "url": "http://localhost:9998/api", - "description": "Generated server url" + "url" : "http://localhost:9998/api", + "description" : "Generated server url" } ], - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ], - "tags": [ + "tags" : [ { - "name": "ShellDescriptorController", - "description": "Shell Descriptor Controller" + "name" : "ShellDescriptorController", + "description" : "Shell Descriptor Controller" }, { - "name": "Investigations", - "description": "Operations on Investigation Notification" + "name" : "Investigations", + "description" : "Operations on Investigation Notification" } ], - "paths": { - "/bpn-config": { - "get": { - "tags": [ + "paths" : { + "/bpn-config" : { + "get" : { + "tags" : [ "BpnEdcMapping" ], - "summary": "Get BPN EDC URL mappings", - "description": "The endpoint returns a result of BPN EDC URL mappings.", - "operationId": "getBpnEdcs", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Get BPN EDC URL mappings", + "description" : "The endpoint returns a result of BPN EDC URL mappings.", + "operationId" : "getBpnEdcs", + "responses" : { + "200" : { + "description" : "Returns the paged result found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "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" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "200": { - "description": "Returns the paged result found", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "put": { - "tags": [ + "put" : { + "tags" : [ "BpnEdcMapping" ], - "summary": "Updates BPN EDC URL mappings", - "description": "The endpoint updates BPN EDC URL mappings", - "operationId": "updateBpnEdcMappings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "maxItems": 1000, - "minItems": 0, - "type": "array", - "items": { - "$ref": "#/components/schemas/BpnMappingRequest" + "summary" : "Updates BPN EDC URL mappings", + "description" : "The endpoint updates BPN EDC URL mappings", + "operationId" : "updateBpnEdcMappings", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnMappingRequest" } } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "415": { - "description": "Unsupported media type", - "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "post": { - "tags": [ + "post" : { + "tags" : [ "BpnEdcMapping" ], - "summary": "Creates BPN EDC URL mappings", - "description": "The endpoint creates BPN EDC URL mappings", - "operationId": "createBpnEdcUrlMappings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "maxItems": 1000, - "minItems": 0, - "type": "array", - "items": { - "$ref": "#/components/schemas/BpnMappingRequest" + "summary" : "Creates BPN EDC URL mappings", + "description" : "The endpoint creates BPN EDC URL mappings", + "operationId" : "createBpnEdcUrlMappings", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BpnMappingRequest" } } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns the paged result found for BpnEdcMapping", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "415": { - "description": "Unsupported media type", - "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/submodel/data/{submodelId}": { - "get": { - "tags": [ + "/submodel/data/{submodelId}" : { + "get" : { + "tags" : [ "Submodel" ], - "summary": "Gets Submodel by its id", - "description": "The endpoint returns Submodel for given id. Used for data providing functionality", - "operationId": "getSubmodelById", - "parameters": [ + "summary" : "Gets Submodel by its id", + "description" : "The endpoint returns Submodel for given id. Used for data providing functionality", + "operationId" : "getSubmodelById", + "parameters" : [ { - "name": "submodelId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "submodelId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + "responses" : { + "200" : { + "description" : "Returns the paged result found", + "content" : { + "application/json" : {} } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "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" } } } }, - "415": { - "description": "Unsupported media type", - "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", - "content": { - "application/json": {} + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "post": { - "tags": [ + "post" : { + "tags" : [ "Submodel" ], - "summary": "Save Submodel", - "description": "This endpoint allows you to save a Submodel identified by its ID.", - "operationId": "saveSubmodel", - "parameters": [ + "summary" : "Save Submodel", + "description" : "This endpoint allows you to save a Submodel identified by its ID.", + "operationId" : "saveSubmodel", + "parameters" : [ { - "name": "submodelId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "submodelId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "string" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "type" : "string" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "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" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations": { - "get": { - "tags": [ + "/investigations" : { + "get" : { + "tags" : [ "Investigations" ], - "summary": "Gets investigations", - "description": "The endpoint returns investigations as paged result.", - "operationId": "getInvestigations", - "parameters": [ + "summary" : "Gets investigations", + "description" : "The endpoint returns investigations as paged result.", + "operationId" : "getInvestigations", + "parameters" : [ { - "name": "pageable", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OwnPageable" + "name" : "pageable", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/OwnPageable" } }, { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/SearchCriteriaRequestParam" + "name" : "filter", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses": { - "200": { - "description": "Returns the paged result found for Asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "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" } } } }, - "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" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "post": { - "tags": [ + "post" : { + "tags" : [ "Investigations" ], - "summary": "Start investigations by part ids", - "description": "The endpoint starts investigations based on part ids provided.", - "operationId": "investigateAssets", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StartQualityNotificationRequest" + "summary" : "Start investigations by part ids", + "description" : "The endpoint starts investigations based on part ids provided.", + "operationId" : "investigateAssets", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StartQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "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" } } } }, - "201": { - "description": "Created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QualityNotificationIdResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations/{investigationId}/update": { - "post": { - "tags": [ + "/investigations/{investigationId}/update" : { + "post" : { + "tags" : [ "Investigations" ], - "summary": "Update investigations by id", - "description": "The endpoint updates investigations by their id.", - "operationId": "updateInvestigation", - "parameters": [ + "summary" : "Update investigations by id", + "description" : "The endpoint updates investigations by their id.", + "operationId" : "updateInvestigation", + "parameters" : [ { - "name": "investigationId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "investigationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateQualityNotificationRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations/{investigationId}/close": { - "post": { - "tags": [ + "/investigations/{investigationId}/close" : { + "post" : { + "tags" : [ "Investigations" ], - "summary": "Close investigations by id", - "description": "The endpoint closes investigations by their id.", - "operationId": "closeInvestigation", - "parameters": [ + "summary" : "Close investigations by id", + "description" : "The endpoint closes investigations by their id.", + "operationId" : "closeInvestigation", + "parameters" : [ { - "name": "investigationId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "investigationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloseQualityNotificationRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CloseQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations/{investigationId}/cancel": { - "post": { - "tags": [ + "/investigations/{investigationId}/cancel" : { + "post" : { + "tags" : [ "Investigations" ], - "summary": "Cancles investigations by id", - "description": "The endpoint cancles investigations by their id.", - "operationId": "cancelInvestigation", - "parameters": [ + "summary" : "Cancles investigations by id", + "description" : "The endpoint cancles investigations by their id.", + "operationId" : "cancelInvestigation", + "parameters" : [ { - "name": "investigationId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "investigationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "204" : { + "description" : "No content." + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations/{investigationId}/approve": { - "post": { - "tags": [ + "/investigations/{investigationId}/approve" : { + "post" : { + "tags" : [ "Investigations" ], - "summary": "Approves investigations by id", - "description": "The endpoint approves investigations by their id.", - "operationId": "approveInvestigation", - "parameters": [ + "summary" : "Approves investigations by id", + "description" : "The endpoint approves investigations by their id.", + "operationId" : "approveInvestigation", + "parameters" : [ { - "name": "investigationId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "investigationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/edc/notification/contract": { - "post": { - "tags": [ + "/edc/notification/contract" : { + "post" : { + "tags" : [ "Notifications" ], - "summary": "Triggers EDC notification contract", - "description": "The endpoint Triggers EDC notification contract based on notification type and method", - "operationId": "createNotificationContract", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateNotificationContractRequest" + "summary" : "Triggers EDC notification contract", + "description" : "The endpoint Triggers EDC notification contract based on notification type and method", + "operationId" : "createNotificationContract", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CreateNotificationContractRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "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" } } } }, - "201": { - "description": "Created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateNotificationContractResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned/sync": { - "post": { - "tags": [ + "/assets/as-planned/sync" : { + "post" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Synchronizes assets from IRS", - "description": "The endpoint synchronizes the assets from irs.", - "operationId": "sync", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SyncAssetsRequest" + "summary" : "Synchronizes assets from IRS", + "description" : "The endpoint synchronizes the assets from irs.", + "operationId" : "sync", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncAssetsRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "201" : { + "description" : "Created." + }, + "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" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned/detail-information": { - "post": { - "tags": [ + "/assets/as-planned/detail-information" : { + "post" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Searches for assets by ids.", - "description": "The endpoint searchs for assets by id and returns a list of them.", - "operationId": "getDetailInformation", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetDetailInformationRequest" + "summary" : "Searches for assets by ids.", + "description" : "The endpoint searchs for assets by id and returns a list of them.", + "operationId" : "getDetailInformation", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetDetailInformationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns the paged result found for Asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "200": { - "description": "Returns the paged result found for Asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built/sync": { - "post": { - "tags": [ + "/assets/as-built/sync" : { + "post" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Synchronizes assets from IRS", - "description": "The endpoint synchronizes the assets from irs.", - "operationId": "sync_1", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SyncAssetsRequest" + "summary" : "Synchronizes assets from IRS", + "description" : "The endpoint synchronizes the assets from irs.", + "operationId" : "sync_1", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SyncAssetsRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "201" : { + "description" : "Created." + }, + "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" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built/detail-information": { - "post": { - "tags": [ + "/assets/as-built/detail-information" : { + "post" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Searches for assets by ids.", - "description": "The endpoint searchs for assets by id and returns a list of them.", - "operationId": "getDetailInformation_1", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetDetailInformationRequest" + "summary" : "Searches for assets by ids.", + "description" : "The endpoint searchs for assets by id and returns a list of them.", + "operationId" : "getDetailInformation_1", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetDetailInformationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns the paged result found for Asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts": { - "get": { - "tags": [ + "/alerts" : { + "get" : { + "tags" : [ "Alerts" ], - "summary": "Gets alerts", - "description": "The endpoint returns alerts as paged result.", - "operationId": "getAlerts", - "parameters": [ + "summary" : "Gets alerts", + "description" : "The endpoint returns alerts as paged result.", + "operationId" : "getAlerts", + "parameters" : [ { - "name": "pageable", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OwnPageable" + "name" : "pageable", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/OwnPageable" } }, { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/SearchCriteriaRequestParam" + "name" : "filter", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "200": { - "description": "Returns the paged result found for Asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "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" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns the paged result found for Asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "post": { - "tags": [ + "post" : { + "tags" : [ "Alerts" ], - "summary": "Start alert by part ids", - "description": "The endpoint starts alert based on part ids provided.", - "operationId": "alertAssets", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StartQualityNotificationRequest" + "summary" : "Start alert by part ids", + "description" : "The endpoint starts alert based on part ids provided.", + "operationId" : "alertAssets", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StartQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "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" } } } }, - "201": { - "description": "Created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QualityNotificationIdResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts/{alertId}/update": { - "post": { - "tags": [ + "/alerts/{alertId}/update" : { + "post" : { + "tags" : [ "Alerts" ], - "summary": "Update alert by id", - "description": "The endpoint updates alert by their id.", - "operationId": "updateAlert", - "parameters": [ + "summary" : "Update alert by id", + "description" : "The endpoint updates alert by their id.", + "operationId" : "updateAlert", + "parameters" : [ { - "name": "alertId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "alertId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateQualityNotificationRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts/{alertId}/close": { - "post": { - "tags": [ + "/alerts/{alertId}/close" : { + "post" : { + "tags" : [ "Alerts" ], - "summary": "Close alert by id", - "description": "The endpoint closes alert by id.", - "operationId": "closeAlert", - "parameters": [ + "summary" : "Close alert by id", + "description" : "The endpoint closes alert by id.", + "operationId" : "closeAlert", + "parameters" : [ { - "name": "alertId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "alertId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CloseQualityNotificationRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CloseQualityNotificationRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts/{alertId}/cancel": { - "post": { - "tags": [ + "/alerts/{alertId}/cancel" : { + "post" : { + "tags" : [ "Alerts" ], - "summary": "Cancels alert by id", - "description": "The endpoint cancels alert by id.", - "operationId": "cancelAlert", - "parameters": [ + "summary" : "Cancels alert by id", + "description" : "The endpoint cancels alert by id.", + "operationId" : "cancelAlert", + "parameters" : [ { - "name": "alertId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "alertId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts/{alertId}/approve": { - "post": { - "tags": [ + "/alerts/{alertId}/approve" : { + "post" : { + "tags" : [ "Alerts" ], - "summary": "Approves alert by id", - "description": "The endpoint approves alert by id.", - "operationId": "approveAlert", - "parameters": [ + "summary" : "Approves alert by id", + "description" : "The endpoint approves alert by id.", + "operationId" : "approveAlert", + "parameters" : [ { - "name": "alertId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "name" : "alertId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "204" : { + "description" : "No content." + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "No content." - }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned/{assetId}": { - "get": { - "tags": [ + "/assets/as-planned/{assetId}" : { + "get" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Get asset by id", - "description": "The endpoint returns an asset filtered by id .", - "operationId": "assetById", - "parameters": [ + "summary" : "Get asset by id", + "description" : "The endpoint returns an asset filtered by id .", + "operationId" : "assetById", + "parameters" : [ { - "name": "assetId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "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" + "200" : { + "description" : "Returns the assets found", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -2592,14 +2592,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -2607,43 +2607,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -2652,173 +2652,153 @@ } } }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "patch": { - "tags": [ + "patch" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Updates asset", - "description": "The endpoint updates asset by provided quality type.", - "operationId": "updateAsset", - "parameters": [ + "summary" : "Updates asset", + "description" : "The endpoint updates asset by provided quality type.", + "operationId" : "updateAsset", + "parameters" : [ { - "name": "assetId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAssetRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateAssetRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the updated asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns the updated asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -2826,14 +2806,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -2841,43 +2821,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -2886,165 +2866,165 @@ } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built/{assetId}": { - "get": { - "tags": [ + "/assets/as-built/{assetId}" : { + "get" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Get asset by id", - "description": "The endpoint returns an asset filtered by id .", - "operationId": "assetById_1", - "parameters": [ + "summary" : "Get asset by id", + "description" : "The endpoint returns an asset filtered by id .", + "operationId" : "assetById_1", + "parameters" : [ { - "name": "assetId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the assets found", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "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" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -3052,14 +3032,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -3067,43 +3047,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -3112,193 +3092,213 @@ } } }, - "400": { - "description": "Bad request.", - "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" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "patch": { - "tags": [ + "patch" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Updates asset", - "description": "The endpoint updates asset by provided quality type.", - "operationId": "updateAsset_1", - "parameters": [ + "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" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAssetRequest" + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateAssetRequest" } } }, - "required": true + "required" : true }, - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the updated asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns the updated asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -3306,14 +3306,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -3321,43 +3321,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -3366,687 +3366,818 @@ } } }, - "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" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/shelldescriptors": { - "get": { - "tags": [ + "/shelldescriptors" : { + "get" : { + "tags" : [ "ShellDescriptorController" ], - "summary": "FindAll shell descriptors", - "description": "The endpoint returns all shell descriptors.", - "operationId": "findAll", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "FindAll shell descriptors", + "description" : "The endpoint returns all shell descriptors.", + "operationId" : "findAll", + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "ShellDescriptors found.", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ShellDescriptorResponse" + } } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "200": { - "description": "ShellDescriptors found.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ShellDescriptorResponse" - } + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] }, - "delete": { - "tags": [ + "delete" : { + "tags" : [ "Registry", "ShellDescriptorController" ], - "summary": "Triggers deleteAll of shell descriptors list", - "description": "The endpoint deletes all shell descriptors.", - "operationId": "deleteAll", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Triggers deleteAll of shell descriptors list", + "description" : "The endpoint deletes all shell descriptors.", + "operationId" : "deleteAll", + "responses" : { + "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" } } } }, - "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" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/registry/reload": { - "get": { - "tags": [ + "/registry/reload" : { + "get" : { + "tags" : [ "Registry" ], - "summary": "Triggers reload of shell descriptors", - "description": "The endpoint Triggers reload of shell descriptors.", - "operationId": "reload", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Triggers reload of shell descriptors", + "description" : "The endpoint Triggers reload of shell descriptors.", + "operationId" : "reload", + "responses" : { + "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" + } + } + } + }, + "202" : { + "description" : "Created registry reload job." + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security" : [ + { + "oAuth2" : [ + "profile email" + ] + } + ] + } + }, + "/investigations/{investigationId}" : { + "get" : { + "tags" : [ + "Investigations" + ], + "summary" : "Gets investigations by id", + "description" : "The endpoint returns investigations as paged result by their id.", + "operationId" : "getInvestigation", + "parameters" : [ + { + "name" : "investigationId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "responses" : { + "200" : { + "description" : "OK.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : -2147483648, + "type" : "array", + "description" : "Investigations", + "items" : { + "$ref" : "#/components/schemas/InvestigationResponse" + } } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "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" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "202": { - "description": "Created registry reload job." + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/investigations/{investigationId}": { - "get": { - "tags": [ + "/investigations/distinctFilterValues" : { + "get" : { + "tags" : [ + "Assets", "Investigations" ], - "summary": "Gets investigations by id", - "description": "The endpoint returns investigations as paged result by their id.", - "operationId": "getInvestigation", - "parameters": [ + "summary" : "getDistinctFilterValues", + "description" : "The endpoint returns a distinct filter values for given fieldName.", + "operationId" : "distinctFilterValues", + "parameters" : [ + { + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, + { + "name" : "size", + "in" : "query", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { - "name": "investigationId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "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" + "responses" : { + "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": { - "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" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "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" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/dashboard": { - "get": { - "tags": [ + "/dashboard" : { + "get" : { + "tags" : [ "Dashboard" ], - "summary": "Returns dashboard related data", - "description": "The endpoint can return limited data based on the user role", - "operationId": "dashboard", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Returns dashboard related data", + "description" : "The endpoint can return limited data based on the user role", + "operationId" : "dashboard", + "responses" : { + "200" : { + "description" : "Returns dashboard data", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/DashboardResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "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" } } } }, - "415": { - "description": "Unsupported media type", - "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 dashboard data", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DashboardResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned": { - "get": { - "tags": [ + "/assets/as-planned" : { + "get" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Get assets by pagination", - "description": "The endpoint returns a paged result of assets.", - "operationId": "AssetsAsPlanned", - "parameters": [ + "summary" : "Get assets by pagination", + "description" : "The endpoint returns a paged result of assets.", + "operationId" : "AssetsAsPlanned", + "parameters" : [ { - "name": "pageable", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OwnPageable" + "name" : "pageable", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/OwnPageable" } }, { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/SearchCriteriaRequestParam" + "name" : "filter", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses": { - "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" + "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" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -4054,14 +4185,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4069,43 +4200,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -4115,203 +4246,223 @@ } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "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" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned/{assetId}/children/{childId}": { - "get": { - "tags": [ + "/assets/as-planned/{assetId}/children/{childId}" : { + "get" : { + "tags" : [ "AssetsAsPlanned" ], - "summary": "Get asset by child id", - "description": "The endpoint returns an asset filtered by child id.", - "operationId": "assetByChildId", - "parameters": [ + "summary" : "Get asset by child id", + "description" : "The endpoint returns an asset filtered by child id.", + "operationId" : "assetByChildId", + "parameters" : [ { - "name": "assetId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } }, { - "name": "childId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "childId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the asset by childId", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns the asset by childId", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -4319,14 +4470,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4334,43 +4485,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -4379,108 +4530,98 @@ } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-planned/distinctFilterValues": { - "get": { - "tags": [ + "/assets/as-planned/distinctFilterValues" : { + "get" : { + "tags" : [ "Assets", "AssetsAsPlanned" ], - "summary": "getDistinctFilterValues", - "description": "The endpoint returns a distinct filter values for given fieldName.", - "operationId": "distinctFilterValues", - "parameters": [ + "summary" : "getDistinctFilterValues", + "description" : "The endpoint returns a distinct filter values for given fieldName.", + "operationId" : "distinctFilterValues_1", + "parameters" : [ { - "name": "fieldName", - "in": "query", - "required": true, - "schema": { - "type": "string" + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" } }, { - "name": "size", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int32" + "name" : "size", + "in" : "query", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" } }, { - "name": "startWith", - "in": "query", - "required": true, - "schema": { - "type": "string" + "name" : "startWith", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" } }, { - "name": "owner", - "in": "query", - "required": true, - "schema": { - "type": "string", - "enum": [ + "name" : "owner", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", @@ -4489,230 +4630,210 @@ } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "400" : { + "description" : "Bad request.", + "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" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "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" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built": { - "get": { - "tags": [ + "/assets/as-built" : { + "get" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Get assets by pagination", - "description": "The endpoint returns a paged result of assets.", - "operationId": "assets", - "parameters": [ + "summary" : "Get assets by pagination", + "description" : "The endpoint returns a paged result of assets.", + "operationId" : "assets", + "parameters" : [ { - "name": "pageable", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OwnPageable" + "name" : "pageable", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/OwnPageable" } }, { - "name": "searchCriteriaRequestParam", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/SearchCriteriaRequestParam" + "name" : "searchCriteriaRequestParam", + "in" : "query", + "required" : true, + "schema" : { + "$ref" : "#/components/schemas/SearchCriteriaRequestParam" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the paged result found for Asset", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array", - "items": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "responses" : { + "200" : { + "description" : "Returns the paged result found for Asset", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array", + "items" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -4720,14 +4841,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4735,43 +4856,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -4781,183 +4902,263 @@ } } }, - "400": { - "description": "Bad request.", - "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" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built/{assetId}/children/{childId}": { - "get": { - "tags": [ + "/assets/as-built/{assetId}/children/{childId}" : { + "get" : { + "tags" : [ "AssetsAsBuilt" ], - "summary": "Get asset by child id", - "description": "The endpoint returns an asset filtered by child id.", - "operationId": "assetByChildId_1", - "parameters": [ + "summary" : "Get asset by child id", + "description" : "The endpoint returns an asset filtered by child id.", + "operationId" : "assetByChildId_1", + "parameters" : [ { - "name": "assetId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "assetId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } }, { - "name": "childId", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "childId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "200": { - "description": "Returns the asset by childId", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Assets", - "items": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "200" : { + "description" : "Returns the asset by childId", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticModelId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "semanticModelId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "businessPartner": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "businessPartner" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "nameAtManufacturer": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "nameAtManufacturer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "manufacturerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "manufacturerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "owner": { - "type": "string", - "enum": [ + "owner" : { + "type" : "string", + "enum" : [ "SUPPLIER", "CUSTOMER", "OWN", "UNKNOWN" ] }, - "childRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Child relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "childRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Child relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "parentRelations": { - "maxItems": 2147483647, - "type": "array", - "description": "Parent relationships", - "items": { - "$ref": "#/components/schemas/DescriptionsResponse" + "parentRelations" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Parent relationships", + "items" : { + "$ref" : "#/components/schemas/DescriptionsResponse" } }, - "activeAlert": { - "type": "boolean" + "activeAlert" : { + "type" : "boolean" }, - "underInvestigation": { - "type": "boolean" + "underInvestigation" : { + "type" : "boolean" }, - "qualityType": { - "type": "string", - "enum": [ + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -4965,14 +5166,14 @@ "LifeThreatening" ] }, - "van": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "van" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "semanticDataModel": { - "type": "string", - "enum": [ + "semanticDataModel" : { + "type" : "string", + "enum" : [ "BATCH", "SERIALPART", "UNKNOWN", @@ -4980,43 +5181,43 @@ "JUSTINSEQUENCE" ] }, - "classification": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "classification" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "detailAspectModels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectModelResponse" + "detailAspectModels" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectModelResponse" } }, - "sentQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityAlertIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityAlertIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "sentQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "sentQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } }, - "receivedQualityInvestigationIdsInStatusActive": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" + "receivedQualityInvestigationIdsInStatusActive" : { + "type" : "array", + "items" : { + "type" : "integer", + "format" : "int64" } } } @@ -5024,626 +5225,707 @@ } } } + } + }, + "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" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } + }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" + } + } + } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "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" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "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_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" - ] - } - } + "/assets/as-built/countries" : { + "get" : { + "tags" : [ + "AssetsAsBuilt" ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Get map of assets", + "description" : "The endpoint returns a map for assets consumed by the map.", + "operationId" : "assetsCountryMap", + "responses" : { + "200" : { + "description" : "Returns the assets found", + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int64" + } } } } }, - "200": { - "description": "Returns a distinct filter values for given fieldName.", - "content": { - "application/json": { - "schema": { - "maxItems": 2147483647, - "minItems": 0, - "type": "array" + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/assets/as-built/countries": { - "get": { - "tags": [ - "AssetsAsBuilt" + "/alerts/{alertId}" : { + "get" : { + "tags" : [ + "Alerts" ], - "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" + "summary" : "Gets Alert by id", + "description" : "The endpoint returns alert by id.", + "operationId" : "getAlert", + "parameters" : [ + { + "name" : "alertId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + ], + "responses" : { + "200" : { + "description" : "OK.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Alerts", + "items" : { + "$ref" : "#/components/schemas/AlertResponse" + } } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "200": { - "description": "Returns the assets found", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int64" - } + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/alerts/{alertId}": { - "get": { - "tags": [ + "/alerts/distinctFilterValues" : { + "get" : { + "tags" : [ + "Assets", "Alerts" ], - "summary": "Gets Alert by id", - "description": "The endpoint returns alert by id.", - "operationId": "getAlert", - "parameters": [ + "summary" : "getDistinctFilterValues", + "description" : "The endpoint returns a distinct filter values for given fieldName.", + "operationId" : "distinctFilterValues_3", + "parameters" : [ + { + "name" : "fieldName", + "in" : "query", + "required" : true, + "schema" : { + "type" : "string" + } + }, { - "name": "alertId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int64" + "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" + "responses" : { + "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": { - "schema": { - "maxItems": 2147483647, - "type": "array", - "description": "Alerts", - "items": { - "$ref": "#/components/schemas/AlertResponse" - } + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "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" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "200" : { + "description" : "Returns a distinct filter values for given fieldName.", + "content" : { + "application/json" : { + "schema" : { + "maxItems" : 2147483647, + "minItems" : 0, + "type" : "array" } } } }, - "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" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/submodel/data": { - "delete": { - "tags": [ + "/submodel/data" : { + "delete" : { + "tags" : [ "Submodel" ], - "summary": "Delete All Submodels", - "description": "Deletes all submodels from the system.", - "operationId": "deleteSubmodels", - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "summary" : "Delete All Submodels", + "description" : "Deletes all submodels from the system.", + "operationId" : "deleteSubmodels", + "responses" : { + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "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" + "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" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } ] } }, - "/bpn-config/{bpn}": { - "delete": { - "tags": [ + "/bpn-config/{bpn}" : { + "delete" : { + "tags" : [ "BpnEdcMapping" ], - "summary": "Deletes BPN EDC URL mappings", - "description": "The endpoint deletes BPN EDC URL mappings", - "operationId": "deleteBpnEdcUrlMappings", - "parameters": [ + "summary" : "Deletes BPN EDC URL mappings", + "description" : "The endpoint deletes BPN EDC URL mappings", + "operationId" : "deleteBpnEdcUrlMappings", + "parameters" : [ { - "name": "bpn", - "in": "path", - "required": true, - "schema": { - "type": "string" + "name" : "bpn", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" } } ], - "responses": { - "429": { - "description": "Too many requests.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "responses" : { + "204" : { + "description" : "Deleted." + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "204": { - "description": "Deleted." - }, - "403": { - "description": "Forbidden.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "400": { - "description": "Bad request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "403" : { + "description" : "Forbidden.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "415": { - "description": "Unsupported media type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "404" : { + "description" : "Not found.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "401": { - "description": "Authorization failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "401" : { + "description" : "Authorization failed.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "404": { - "description": "Not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "500" : { + "description" : "Internal server error.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } }, - "500": { - "description": "Internal server error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "429" : { + "description" : "Too many requests.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ErrorResponse" } } } } }, - "security": [ + "security" : [ { - "oAuth2": [ + "oAuth2" : [ "profile email" ] } @@ -5651,134 +5933,134 @@ } } }, - "components": { - "schemas": { - "BpnMappingRequest": { - "required": [ + "components" : { + "schemas" : { + "BpnMappingRequest" : { + "required" : [ "bpn", "url" ], - "type": "object", - "properties": { - "bpn": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "url": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "type" : "object", + "properties" : { + "bpn" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "url" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "ErrorResponse": { - "type": "object", - "properties": { - "message": { - "maxLength": 1000, - "minLength": 0, - "pattern": "^.*$", - "type": "string" + "ErrorResponse" : { + "type" : "object", + "properties" : { + "message" : { + "maxLength" : 1000, + "minLength" : 0, + "pattern" : "^.*$", + "type" : "string" } } }, - "StartQualityNotificationRequest": { - "required": [ + "StartQualityNotificationRequest" : { + "required" : [ "severity" ], - "type": "object", - "properties": { - "partIds": { - "maxItems": 100, - "minItems": 1, - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "maxLength": 1000, - "minLength": 15, - "type": "string" - }, - "targetDate": { - "type": "string", - "format": "date-time" - }, - "severity": { - "type": "string", - "enum": [ + "type" : "object", + "properties" : { + "partIds" : { + "maxItems" : 100, + "minItems" : 1, + "type" : "array", + "items" : { + "type" : "string" + } + }, + "description" : { + "maxLength" : 1000, + "minLength" : 15, + "type" : "string" + }, + "targetDate" : { + "type" : "string", + "format" : "date-time" + }, + "severity" : { + "type" : "string", + "enum" : [ "MINOR", "MAJOR", "CRITICAL", "LIFE_THREATENING" ] }, - "receiverBpn": { - "type": "string" + "receiverBpn" : { + "type" : "string" }, - "asBuilt": { - "type": "boolean" + "asBuilt" : { + "type" : "boolean" } } }, - "QualityNotificationIdResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" + "QualityNotificationIdResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" } } }, - "UpdateQualityNotificationRequest": { - "required": [ + "UpdateQualityNotificationRequest" : { + "required" : [ "status" ], - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "The UpdateInvestigationStatus", - "enum": [ + "type" : "object", + "properties" : { + "status" : { + "type" : "string", + "description" : "The UpdateInvestigationStatus", + "enum" : [ "ACKNOWLEDGED", "ACCEPTED", "DECLINED" ] }, - "reason": { - "type": "string" + "reason" : { + "type" : "string" } } }, - "CloseQualityNotificationRequest": { - "type": "object", - "properties": { - "reason": { - "maxLength": 1000, - "minLength": 15, - "type": "string" + "CloseQualityNotificationRequest" : { + "type" : "object", + "properties" : { + "reason" : { + "maxLength" : 1000, + "minLength" : 15, + "type" : "string" } } }, - "CreateNotificationContractRequest": { - "required": [ + "CreateNotificationContractRequest" : { + "required" : [ "notificationMethod", "notificationType" ], - "type": "object", - "properties": { - "notificationType": { - "type": "string", - "enum": [ + "type" : "object", + "properties" : { + "notificationType" : { + "type" : "string", + "enum" : [ "QUALITY_INVESTIGATION", "QUALITY_ALERT" ] }, - "notificationMethod": { - "type": "string", - "enum": [ + "notificationMethod" : { + "type" : "string", + "enum" : [ "RECEIVE", "UPDATE", "RESOLVE" @@ -5786,56 +6068,56 @@ } } }, - "CreateNotificationContractResponse": { - "type": "object", - "properties": { - "notificationAssetId": { - "type": "string" + "CreateNotificationContractResponse" : { + "type" : "object", + "properties" : { + "notificationAssetId" : { + "type" : "string" }, - "accessPolicyId": { - "type": "string" + "accessPolicyId" : { + "type" : "string" }, - "contractDefinitionId": { - "type": "string" + "contractDefinitionId" : { + "type" : "string" } } }, - "SyncAssetsRequest": { - "type": "object", - "properties": { - "globalAssetIds": { - "maxItems": 100, - "minItems": 1, - "type": "array", - "description": "Assets", - "items": { - "type": "string" + "SyncAssetsRequest" : { + "type" : "object", + "properties" : { + "globalAssetIds" : { + "maxItems" : 100, + "minItems" : 1, + "type" : "array", + "description" : "Assets", + "items" : { + "type" : "string" } } } }, - "GetDetailInformationRequest": { - "type": "object", - "properties": { - "assetIds": { - "maxItems": 50, - "minItems": 1, - "type": "array", - "items": { - "type": "string" + "GetDetailInformationRequest" : { + "type" : "object", + "properties" : { + "assetIds" : { + "maxItems" : 50, + "minItems" : 1, + "type" : "array", + "items" : { + "type" : "string" } } } }, - "UpdateAssetRequest": { - "required": [ + "UpdateAssetRequest" : { + "required" : [ "qualityType" ], - "type": "object", - "properties": { - "qualityType": { - "type": "string", - "enum": [ + "type" : "object", + "properties" : { + "qualityType" : { + "type" : "string", + "enum" : [ "Ok", "Minor", "Major", @@ -5845,125 +6127,125 @@ } } }, - "DescriptionsResponse": { - "type": "object", - "properties": { - "id": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "idShort": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "DescriptionsResponse" : { + "type" : "object", + "properties" : { + "id" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "idShort" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "DetailAspectDataAsBuiltResponse": { - "type": "object", - "properties": { - "partId": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "customerPartId": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "nameAtCustomer": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "manufacturingCountry": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "manufacturingDate": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "DetailAspectDataAsBuiltResponse" : { + "type" : "object", + "properties" : { + "partId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "customerPartId" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "nameAtCustomer" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "manufacturingCountry" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "manufacturingDate" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "DetailAspectDataAsPlannedResponse": { - "type": "object", - "properties": { - "validityPeriodFrom": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "validityPeriodTo": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "DetailAspectDataAsPlannedResponse" : { + "type" : "object", + "properties" : { + "validityPeriodFrom" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "validityPeriodTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "DetailAspectDataResponse": { - "type": "object", - "oneOf": [ + "DetailAspectDataResponse" : { + "type" : "object", + "oneOf" : [ { - "$ref": "#/components/schemas/DetailAspectDataAsBuiltResponse" + "$ref" : "#/components/schemas/DetailAspectDataAsBuiltResponse" }, { - "$ref": "#/components/schemas/DetailAspectDataAsPlannedResponse" + "$ref" : "#/components/schemas/DetailAspectDataAsPlannedResponse" }, { - "$ref": "#/components/schemas/PartSiteInformationAsPlannedResponse" + "$ref" : "#/components/schemas/PartSiteInformationAsPlannedResponse" }, { - "$ref": "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" + "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeResponse" } ] }, - "DetailAspectDataTractionBatteryCodeResponse": { - "type": "object", - "properties": { - "productType": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "DetailAspectDataTractionBatteryCodeResponse" : { + "type" : "object", + "properties" : { + "productType" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "tractionBatteryCode": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "tractionBatteryCode" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "subcomponents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" + "subcomponents" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DetailAspectDataTractionBatteryCodeSubcomponentResponse" } } } }, - "DetailAspectDataTractionBatteryCodeSubcomponentResponse": { - "type": "object", - "properties": { - "productType": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "tractionBatteryCode": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "DetailAspectDataTractionBatteryCodeSubcomponentResponse" : { + "type" : "object", + "properties" : { + "productType" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "tractionBatteryCode" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "DetailAspectModelResponse": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ + "DetailAspectModelResponse" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string", + "enum" : [ "AS_BUILT", "AS_PLANNED", "TRACTION_BATTERY_CODE", @@ -5973,90 +6255,90 @@ "PART_SITE_INFORMATION_AS_PLANNED" ] }, - "data": { - "$ref": "#/components/schemas/DetailAspectDataResponse" + "data" : { + "$ref" : "#/components/schemas/DetailAspectDataResponse" } } }, - "PartSiteInformationAsPlannedResponse": { - "type": "object", - "properties": { - "functionValidUntil": { - "type": "string" + "PartSiteInformationAsPlannedResponse" : { + "type" : "object", + "properties" : { + "functionValidUntil" : { + "type" : "string" }, - "function": { - "type": "string" + "function" : { + "type" : "string" }, - "functionValidFrom": { - "type": "string" + "functionValidFrom" : { + "type" : "string" }, - "catenaXSiteId": { - "type": "string" + "catenaXSiteId" : { + "type" : "string" } } }, - "ShellDescriptorResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" + "ShellDescriptorResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" }, - "globalAssetId": { - "type": "string" + "globalAssetId" : { + "type" : "string" } } }, - "OwnPageable": { - "type": "object", - "properties": { - "page": { - "type": "integer", - "format": "int32" - }, - "size": { - "type": "integer", - "format": "int32" - }, - "sort": { - "maxItems": 2147483647, - "type": "array", - "description": "Content of Assets PageResults", - "example": "manufacturerPartId,desc", - "items": { - "type": "string" + "OwnPageable" : { + "type" : "object", + "properties" : { + "page" : { + "type" : "integer", + "format" : "int32" + }, + "size" : { + "type" : "integer", + "format" : "int32" + }, + "sort" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Content of Assets PageResults", + "example" : "manufacturerPartId,desc", + "items" : { + "type" : "string" } } } }, - "SearchCriteriaRequestParam": { - "type": "object", - "properties": { - "filter": { - "maxItems": 2147483647, - "type": "array", - "description": "Filter Criteria", - "example": "owner,EQUAL,OWN", - "items": { - "type": "string" + "SearchCriteriaRequestParam" : { + "type" : "object", + "properties" : { + "filter" : { + "maxItems" : 2147483647, + "type" : "array", + "description" : "Filter Criteria", + "example" : "owner,EQUAL,OWN", + "items" : { + "type" : "string" } } } }, - "InvestigationResponse": { - "type": "object", - "properties": { - "id": { - "maximum": 255, - "minimum": 0, - "type": "integer", - "format": "int64" - }, - "status": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "InvestigationResponse" : { + "type" : "object", + "properties" : { + "id" : { + "maximum" : 255, + "minimum" : 0, + "type" : "integer", + "format" : "int64" + }, + "status" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "CREATED", "SENT", "RECEIVED", @@ -6067,167 +6349,183 @@ "CLOSED" ] }, - "description": { - "maxLength": 1000, - "minLength": 0, - "type": "string" - }, - "createdBy": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "createdByName": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "createdDate": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "assetIds": { - "maxItems": 1000, - "minItems": 0, - "type": "array", - "description": "assetIds", - "items": { - "type": "string" - } - }, - "channel": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "description" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string" + }, + "createdBy" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "createdByName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "createdDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string" + }, + "assetIds" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "description" : "assetIds", + "items" : { + "type" : "string" + } + }, + "channel" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "SENDER", "RECEIVER" ] }, - "reason": { - "$ref": "#/components/schemas/QualityNotificationReasonResponse" + "reason" : { + "$ref" : "#/components/schemas/QualityNotificationReasonResponse" }, - "sendTo": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "sendTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "sendToName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "sendToName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "severity": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "severity" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "MINOR", "MAJOR", "CRITICAL", "LIFE-THREATENING" ] }, - "targetDate": { - "maxLength": 50, - "minLength": 0, - "type": "string" + "targetDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string" }, - "errorMessage": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "errorMessage" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } }, - "QualityNotificationReasonResponse": { - "type": "object", - "properties": { - "close": { - "maxLength": 1000, - "minLength": 0, - "type": "string" - }, - "accept": { - "maxLength": 1000, - "minLength": 0, - "type": "string" - }, - "decline": { - "maxLength": 1000, - "minLength": 0, - "type": "string" + "QualityNotificationReasonResponse" : { + "type" : "object", + "properties" : { + "close" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string" + }, + "accept" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string" + }, + "decline" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string" } } }, - "DashboardResponse": { - "type": "object", - "properties": { - "asBuiltCustomerParts": { - "type": "integer", - "format": "int64" + "DashboardResponse" : { + "type" : "object", + "properties" : { + "asBuiltCustomerParts" : { + "type" : "integer", + "format" : "int64" + }, + "asPlannedCustomerParts" : { + "type" : "integer", + "format" : "int64" + }, + "asBuiltSupplierParts" : { + "type" : "integer", + "format" : "int64" + }, + "asPlannedSupplierParts" : { + "type" : "integer", + "format" : "int64" + }, + "asBuiltOwnParts" : { + "type" : "integer", + "format" : "int64" }, - "asPlannedCustomerParts": { - "type": "integer", - "format": "int64" + "asPlannedOwnParts" : { + "type" : "integer", + "format" : "int64" }, - "asBuiltSupplierParts": { - "type": "integer", - "format": "int64" + "myPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64" }, - "asPlannedSupplierParts": { - "type": "integer", - "format": "int64" + "myPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64" }, - "asBuiltOwnParts": { - "type": "integer", - "format": "int64" + "supplierPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64" }, - "asPlannedOwnParts": { - "type": "integer", - "format": "int64" + "customerPartsWithOpenAlerts" : { + "type" : "integer", + "format" : "int64" }, - "myPartsWithOpenAlerts": { - "type": "integer", - "format": "int64" + "supplierPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64" }, - "myPartsWithOpenInvestigations": { - "type": "integer", - "format": "int64" + "customerPartsWithOpenInvestigations" : { + "type" : "integer", + "format" : "int64" }, - "supplierPartsWithOpenAlerts": { - "type": "integer", - "format": "int64" + "receivedActiveAlerts" : { + "type" : "integer", + "format" : "int64" }, - "customerPartsWithOpenAlerts": { - "type": "integer", - "format": "int64" + "receivedActiveInvestigations" : { + "type" : "integer", + "format" : "int64" }, - "supplierPartsWithOpenInvestigations": { - "type": "integer", - "format": "int64" + "sentActiveAlerts" : { + "type" : "integer", + "format" : "int64" }, - "customerPartsWithOpenInvestigations": { - "type": "integer", - "format": "int64" + "sentActiveInvestigations" : { + "type" : "integer", + "format" : "int64" } } }, - "AlertResponse": { - "type": "object", - "properties": { - "id": { - "maximum": 255, - "minimum": 0, - "type": "integer", - "format": "int64" - }, - "status": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "AlertResponse" : { + "type" : "object", + "properties" : { + "id" : { + "maximum" : 255, + "minimum" : 0, + "type" : "integer", + "format" : "int64" + }, + "status" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "CREATED", "SENT", "RECEIVED", @@ -6238,88 +6536,88 @@ "CLOSED" ] }, - "description": { - "maxLength": 1000, - "minLength": 0, - "type": "string" - }, - "createdBy": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "createdByName": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "createdDate": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "assetIds": { - "maxItems": 1000, - "minItems": 0, - "type": "array", - "description": "assetIds", - "items": { - "type": "string" - } - }, - "channel": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "description" : { + "maxLength" : 1000, + "minLength" : 0, + "type" : "string" + }, + "createdBy" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "createdByName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" + }, + "createdDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string" + }, + "assetIds" : { + "maxItems" : 1000, + "minItems" : 0, + "type" : "array", + "description" : "assetIds", + "items" : { + "type" : "string" + } + }, + "channel" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "SENDER", "RECEIVER" ] }, - "reason": { - "$ref": "#/components/schemas/QualityNotificationReasonResponse" + "reason" : { + "$ref" : "#/components/schemas/QualityNotificationReasonResponse" }, - "sendTo": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "sendTo" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "sendToName": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "sendToName" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" }, - "severity": { - "maxLength": 255, - "minLength": 0, - "type": "string", - "enum": [ + "severity" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string", + "enum" : [ "MINOR", "MAJOR", "CRITICAL", "LIFE-THREATENING" ] }, - "targetDate": { - "maxLength": 50, - "minLength": 0, - "type": "string" + "targetDate" : { + "maxLength" : 50, + "minLength" : 0, + "type" : "string" }, - "errorMessage": { - "maxLength": 255, - "minLength": 0, - "type": "string" + "errorMessage" : { + "maxLength" : 255, + "minLength" : 0, + "type" : "string" } } } }, - "securitySchemes": { - "oAuth2": { - "type": "oauth2", - "flows": { - "clientCredentials": { - "scopes": { - "profile email": "" + "securitySchemes" : { + "oAuth2" : { + "type" : "oauth2", + "flows" : { + "clientCredentials" : { + "scopes" : { + "profile email" : "" } } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/base/service/AbstractAssetBaseService.java index 8360c260f1..3fe32eb8b8 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 @@ -41,13 +41,14 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; @Slf4j public abstract class AbstractAssetBaseService implements AssetBaseService { - private static List SUPPORTED_ENUM_FIELDS = List.of("owner", "qualityType", "semanticDataModel"); - private static List SUPPORTED_BOOLEAN_FIELDS = List.of("activeAlert", "underInvestigation"); + private static final List SUPPORTED_ENUM_FIELDS = List.of("owner", "qualityType", "semanticDataModel"); + private static final List SUPPORTED_BOOLEAN_FIELDS = List.of("activeAlert", "underInvestigation"); protected abstract AssetRepository getAssetRepository(); @@ -155,13 +156,15 @@ public Map getAssetsCountryMap() { @Override public List getDistinctFilterValues(String fieldName, String startWith, Integer size, Owner owner) { + final Integer resultSize = Objects.isNull(size) ? Integer.MAX_VALUE : size; + if (isSupportedEnumType(fieldName)) { return getAssetEnumFieldValues(fieldName); } if (isBooleanType(fieldName)) { return List.of("true", "false"); } - return getAssetRepository().getFieldValues(fieldName, startWith, size, owner); + return getAssetRepository().getFieldValues(fieldName, startWith, resultSize, owner); } private boolean isBooleanType(String fieldName) { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/Parameter.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/Parameter.java index 42e829f237..033ec110d4 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/Parameter.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/Parameter.java @@ -18,5 +18,6 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response; +// TODO add bpn here to be able to map the bpn to the assetsasplanned public record Parameter(String direction, String bomLifecycle) { } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/CriteriaUtility.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/CriteriaUtility.java index 06c77c1f3f..998f93f76c 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/CriteriaUtility.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/repository/CriteriaUtility.java @@ -22,11 +22,15 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Join; +import jakarta.persistence.criteria.JoinType; import jakarta.persistence.criteria.Path; import jakarta.persistence.criteria.Predicate; import jakarta.persistence.criteria.Root; import lombok.experimental.UtilityClass; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; +import org.eclipse.tractusx.traceability.common.model.SearchCriteriaFilter; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import java.util.ArrayList; import java.util.List; @@ -55,7 +59,11 @@ public List getDistinctAssetFieldValues( List predicates = new ArrayList<>(); if (nonNull(startWith)) { - predicates.add(builder.like(fieldPath, startWith + "%")); + predicates.add( + builder.like( + builder.lower(fieldPath), + startWith.toLowerCase() + "%") + ); } if (nonNull(owner)) { @@ -66,4 +74,62 @@ public List getDistinctAssetFieldValues( .setMaxResults(resultLimit) .getResultList(); } + + public List getDistinctNotificationFieldValues( + String fieldName, + String startWith, + Integer resultLimit, + QualityNotificationSide side, + Class notificationEntityClass, + EntityManager entityManager) { + + CriteriaBuilder builder = entityManager.getCriteriaBuilder(); + CriteriaQuery cq = builder.createQuery(String.class); + Root root = cq.from(notificationEntityClass); + + Path fieldPath1 = getFieldPath(root, fieldName); + + cq.select(fieldPath1.as(String.class)) + .distinct(true) + .orderBy(List.of(builder.asc(fieldPath1.as(String.class)))); + + List predicates = new ArrayList<>(); + if (nonNull(startWith)) { + predicates.add( + builder.like( + builder.lower(fieldPath1), + startWith.toLowerCase() + "%") + ); + } + + if (nonNull(side)) { + predicates.add(builder.equal(root.get("side").as(String.class), side.name())); + } + cq.where(predicates.toArray(new Predicate[0])); + return entityManager.createQuery(cq) + .setMaxResults(resultLimit) + .getResultList(); + } + + private Path getFieldPath(Root root, String fieldName) { + if (isJoinQueryFieldName(fieldName)) { + Join join = root.join(getJoinTableName(fieldName), JoinType.LEFT); + return join.get(getJoinTableFieldName(fieldName)); + } + return root.get(fieldName); + } + + private boolean isJoinQueryFieldName(String fieldName) { + return fieldName.contains("_"); + } + + private String getJoinTableName(String joinQueryFieldName) { + String[] split = joinQueryFieldName.split("_"); + return split[0]; + } + + private String getJoinTableFieldName(String joinQueryFieldName) { + String[] split = joinQueryFieldName.split("_"); + return split.length == 2 ? split[1] : split[0]; + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java index 3bc94f0278..8a47d09602 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/alert/rest/AlertController.java @@ -29,6 +29,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; +import jakarta.ws.rs.QueryParam; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; import org.eclipse.tractusx.traceability.common.model.PageResult; @@ -38,6 +39,7 @@ import org.eclipse.tractusx.traceability.qualitynotification.application.alert.mapper.AlertResponseMapper; import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; @@ -56,6 +58,8 @@ import qualitynotification.base.request.UpdateQualityNotificationRequest; import qualitynotification.base.response.QualityNotificationIdResponse; +import java.util.List; + import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain.from; @@ -502,5 +506,69 @@ public void updateAlert( log.info(API_LOG_START + "/{}/update with params {}", alertId, cleanUpdateAlertRequest); alertService.update(alertId, from(cleanUpdateAlertRequest.getStatus()), cleanUpdateAlertRequest.getReason()); } + + @Operation(operationId = "distinctFilterValues", + summary = "getDistinctFilterValues", + tags = {"Assets"}, + description = "The endpoint returns a distinct filter values for given fieldName.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns a distinct filter values for given fieldName.", content = @Content( + mediaType = "application/json", + array = @ArraySchema( + arraySchema = @Schema( + description = "FilterValues", + implementation = String.class, + additionalProperties = Schema.AdditionalPropertiesValue.FALSE + ), + maxItems = Integer.MAX_VALUE, + minItems = 0) + )), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) + @GetMapping("distinctFilterValues") + public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { + return alertService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java index fd455adb72..da4c8ba2bc 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/mapper/QualityNotificationFieldMapper.java @@ -41,8 +41,8 @@ public class QualityNotificationFieldMapper extends BaseRequestFieldMapper { Map.entry("severity", "notifications_severity"), Map.entry("createdBy", "notifications_createdBy"), Map.entry("createdByName", "notifications_createdByName"), - Map.entry("sendTo", "notifications_sentTo"), - Map.entry("sendToName", "notifications_sentToName"), + Map.entry("sendTo", "notifications_sendTo"), + Map.entry("sendToName", "notifications_sendToName"), Map.entry("targetDate", "notifications_targetDate"), Map.entry("assetId", "assets_id") diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java index 13bea022cf..f8ed5a561d 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/base/service/QualityNotificationService.java @@ -23,17 +23,16 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.springframework.data.domain.Pageable; +import java.util.List; + public interface QualityNotificationService { QualityNotificationId start(StartQualityNotificationDomain startQualityAlertDomain); - PageResult getCreated(Pageable pageable); - - PageResult getReceived(Pageable pageable); - QualityNotification find(Long notificationId); QualityNotification loadOrNotFoundException(QualityNotificationId notificationId); @@ -47,4 +46,6 @@ public interface QualityNotificationService { void update(Long notificationId, QualityNotificationStatus notificationStatus, String reason); PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria); + + List getDistinctFilterValues(String fieldName, String startWith, Integer size, QualityNotificationSide side); } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java index ab92758e65..4701346175 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/application/investigation/rest/InvestigationsController.java @@ -31,6 +31,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; +import jakarta.ws.rs.QueryParam; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.common.model.BaseRequestFieldMapper; import org.eclipse.tractusx.traceability.common.model.PageResult; @@ -40,11 +41,18 @@ import org.eclipse.tractusx.traceability.qualitynotification.application.base.mapper.QualityNotificationFieldMapper; import org.eclipse.tractusx.traceability.qualitynotification.application.base.service.QualityNotificationService; import org.eclipse.tractusx.traceability.qualitynotification.application.investigation.mapper.InvestigationResponseMapper; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import qualitynotification.base.request.CloseQualityNotificationRequest; import qualitynotification.base.request.QualityNotificationStatusRequest; import qualitynotification.base.request.StartQualityNotificationRequest; @@ -52,6 +60,8 @@ import qualitynotification.base.response.QualityNotificationIdResponse; import qualitynotification.investigation.response.InvestigationResponse; +import java.util.List; + import static org.eclipse.tractusx.traceability.common.model.SecurityUtils.sanitize; import static org.eclipse.tractusx.traceability.qualitynotification.application.validation.UpdateQualityNotificationValidator.validate; import static org.eclipse.tractusx.traceability.qualitynotification.domain.alert.model.exception.StartQualityNotificationDomain.from; @@ -490,5 +500,70 @@ public void updateInvestigation(@PathVariable Long investigationId, @Valid @Requ log.info(API_LOG_START + "/{}/update with params {}", investigationId, cleanUpdateQualityNotificationRequest); investigationService.update(investigationId, from(cleanUpdateQualityNotificationRequest.getStatus()), cleanUpdateQualityNotificationRequest.getReason()); } + + + @Operation(operationId = "distinctFilterValues", + summary = "getDistinctFilterValues", + tags = {"Assets"}, + description = "The endpoint returns a distinct filter values for given fieldName.", + security = @SecurityRequirement(name = "oAuth2", scopes = "profile email")) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Returns a distinct filter values for given fieldName.", content = @Content( + mediaType = "application/json", + array = @ArraySchema( + arraySchema = @Schema( + description = "FilterValues", + implementation = String.class, + additionalProperties = Schema.AdditionalPropertiesValue.FALSE + ), + maxItems = Integer.MAX_VALUE, + minItems = 0) + )), + @ApiResponse( + responseCode = "400", + description = "Bad request.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "401", + description = "Authorization failed.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + + @ApiResponse( + responseCode = "403", + description = "Forbidden.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "404", + description = "Not found.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "415", + description = "Unsupported media type", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "429", + description = "Too many requests.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class))), + @ApiResponse( + responseCode = "500", + description = "Internal server error.", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = ErrorResponse.class)))}) + @GetMapping("distinctFilterValues") + public List distinctFilterValues(@QueryParam("fieldName") String fieldName, @QueryParam("size") Integer size, @QueryParam("startWith") String startWith, @QueryParam("channel") QualityNotificationSide channel) { + return investigationService.getDistinctFilterValues(fieldMapper.mapRequestFieldName(fieldName), startWith, size, channel); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java index af95dc32fd..fc48ff1346 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/alert/service/AlertServiceImpl.java @@ -90,5 +90,4 @@ public void cancel(Long notificationId) { public void setAssetStatus(QualityNotification qualityNotification) { assetService.setAssetsAlertStatus(qualityNotification); } - } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java index 081905091d..aa1c4bf2d6 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/base/service/AbstractQualityNotificationService.java @@ -26,18 +26,21 @@ import org.eclipse.tractusx.traceability.qualitynotification.domain.base.exception.SendNotificationException; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; +import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSeverity; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.repository.QualityNotificationRepository; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; +import java.util.Arrays; import java.util.List; +import java.util.Objects; @Slf4j public abstract class AbstractQualityNotificationService implements QualityNotificationService { + private static final List SUPPORTED_ENUM_FIELDS = List.of("status", "side", "notifications_severity"); + protected abstract NotificationPublisherService getNotificationPublisherService(); protected abstract QualityNotificationRepository getQualityNotificationRepository(); @@ -46,18 +49,6 @@ public abstract class AbstractQualityNotificationService implements QualityNotif protected abstract void setAssetStatus(QualityNotification qualityNotification); - @Deprecated - @Override - public PageResult getCreated(Pageable pageable) { - return getQualityNotificationsPageResult(pageable, QualityNotificationSide.SENDER); - } - - @Deprecated - @Override - public PageResult getReceived(Pageable pageable) { - return getQualityNotificationsPageResult(pageable, QualityNotificationSide.RECEIVER); - } - @Override public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { return getQualityNotificationRepository().getNotifications(pageable, searchCriteria); @@ -97,13 +88,6 @@ public void approve(Long notificationId) { getQualityNotificationRepository().updateQualityNotificationEntity(approvedInvestigation); } - private PageResult getQualityNotificationsPageResult(Pageable pageable, QualityNotificationSide alertSide) { - List alertData = getQualityNotificationRepository().findQualityNotificationsBySide(alertSide, pageable) - .content(); - Page alertDataPage = new PageImpl<>(alertData, pageable, getQualityNotificationRepository().countQualityNotificationEntitiesBySide(alertSide)); - return new PageResult<>(alertDataPage); - } - @Override public void cancel(Long notificationId) { QualityNotification qualityNotification = loadOrNotFoundException(new QualityNotificationId(notificationId)); @@ -112,4 +96,28 @@ public void cancel(Long notificationId) { setAssetStatus(canceledQualityNotification); getQualityNotificationRepository().updateQualityNotificationEntity(canceledQualityNotification); } + + @Override + public List getDistinctFilterValues(String fieldName, String startWith, Integer size, QualityNotificationSide side) { + final Integer resultSize = Objects.isNull(size) ? Integer.MAX_VALUE : size; + + if (isSupportedEnumType(fieldName)) { + return getAssetEnumFieldValues(fieldName); + } + return getQualityNotificationRepository().getDistinctFieldValues(fieldName, startWith, resultSize, side); + } + + private boolean isSupportedEnumType(String fieldName) { + return SUPPORTED_ENUM_FIELDS.contains(fieldName); + } + + private List getAssetEnumFieldValues(String fieldName) { + return switch (fieldName) { + case "status" -> Arrays.stream(QualityNotificationStatus.values()).map(Enum::name).toList(); + case "side" -> Arrays.stream(QualityNotificationSide.values()).map(Enum::name).toList(); + case "notifications_severity" -> + Arrays.stream(QualityNotificationSeverity.values()).map(Enum::name).toList(); + default -> null; + }; + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java index 1f916cd33a..6ba330f8c9 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/domain/repository/QualityNotificationRepository.java @@ -26,9 +26,7 @@ import org.eclipse.tractusx.traceability.common.model.SearchCriteria; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationMessage; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.springframework.data.domain.Pageable; import java.util.List; @@ -36,24 +34,20 @@ public interface QualityNotificationRepository { - PageResult findQualityNotificationsBySide(QualityNotificationSide investigationSide, Pageable pageable); - Optional findOptionalQualityNotificationById(QualityNotificationId investigationId); Optional findByEdcNotificationId(String edcNotificationId); - long countQualityNotificationEntitiesByStatus(QualityNotificationStatus qualityNotificationStatus); - long countQualityNotificationEntitiesBySide(QualityNotificationSide investigationSide); QualityNotificationId saveQualityNotificationEntity(QualityNotification investigation); QualityNotificationId updateQualityNotificationEntity(QualityNotification investigation); - void updateQualityNotificationMessageEntity(QualityNotificationMessage notification); - PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria); long countOpenNotificationsByOwnership(List owners); + List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide owner); + } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java index 6e8ba9f099..2ab2ccc8f2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/alert/repository/AlertsRepositoryImpl.java @@ -19,6 +19,8 @@ package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.repository; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import jakarta.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -30,6 +32,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.base.model.AssetBaseEntity; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.repository.CriteriaUtility; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.AlertRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; @@ -41,7 +44,6 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.alert.model.AlertNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -72,12 +74,8 @@ public class AlertsRepositoryImpl implements AlertRepository { private final Clock clock; - @Override - public void updateQualityNotificationMessageEntity(QualityNotificationMessage notification) { - AlertNotificationEntity entity = notificationRepository.findById(notification.getId()) - .orElseThrow(() -> new IllegalArgumentException(String.format("Notification with id %s not found!", notification.getId()))); - handleNotificationUpdate(entity, notification); - } + @PersistenceContext + private EntityManager entityManager; @Override public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { @@ -122,23 +120,12 @@ public QualityNotificationId saveQualityNotificationEntity(QualityNotification a return new QualityNotificationId(alertEntity.getId()); } - @Override - public PageResult findQualityNotificationsBySide(QualityNotificationSide alertSide, Pageable pageable) { - Page entities = jpaAlertRepository.findAllBySideEquals(NotificationSideBaseEntity.valueOf(alertSide.name()), pageable); - return new PageResult<>(entities, AlertEntity::toDomain); - } - @Override public Optional findOptionalQualityNotificationById(QualityNotificationId alertId) { return jpaAlertRepository.findById(alertId.value()) .map(AlertEntity::toDomain); } - @Override - public long countQualityNotificationEntitiesByStatus(QualityNotificationStatus qualityNotificationStatus) { - return jpaAlertRepository.countAllByStatusEquals(NotificationStatusBaseEntity.valueOf(qualityNotificationStatus.name())); - } - @Transactional @Override public long countPartsByStatusAndOwnership(List statuses, Owner owner) { @@ -240,5 +227,8 @@ private List filterNotificationAssets(QualityNoti .toList(); } - + @Override + public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { + return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, AlertEntity.class, entityManager); + } } diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java index 5e3bd22fbb..69c6b6f735 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/qualitynotification/infrastructure/investigation/repository/InvestigationsRepositoryImpl.java @@ -21,6 +21,8 @@ package org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.repository; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; @@ -28,6 +30,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.common.model.SearchCriteria; +import org.eclipse.tractusx.traceability.common.repository.CriteriaUtility; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationAffectedPart; @@ -39,7 +42,6 @@ import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.investigation.model.InvestigationNotificationEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationSideBaseEntity; import org.eclipse.tractusx.traceability.qualitynotification.infrastructure.model.NotificationStatusBaseEntity; -import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -68,12 +70,8 @@ public class InvestigationsRepositoryImpl implements InvestigationRepository { private final Clock clock; - @Override - public void updateQualityNotificationMessageEntity(QualityNotificationMessage notification) { - InvestigationNotificationEntity entity = notificationRepository.findById(notification.getId()) - .orElseThrow(() -> new IllegalArgumentException(String.format("Notification with id %s not found!", notification.getId()))); - handleNotificationUpdate(entity, notification); - } + @PersistenceContext + private EntityManager entityManager; @Override public PageResult getNotifications(Pageable pageable, SearchCriteria searchCriteria) { @@ -131,23 +129,12 @@ public QualityNotificationId saveQualityNotificationEntity(QualityNotification i } } - @Override - public PageResult findQualityNotificationsBySide(QualityNotificationSide investigationSide, Pageable pageable) { - Page entities = jpaInvestigationRepository.findAllBySideEquals(NotificationSideBaseEntity.valueOf(investigationSide.name()), pageable); - return new PageResult<>(entities, InvestigationEntity::toDomain); - } - @Override public Optional findOptionalQualityNotificationById(QualityNotificationId investigationId) { return jpaInvestigationRepository.findById(investigationId.value()) .map(InvestigationEntity::toDomain); } - @Override - public long countQualityNotificationEntitiesByStatus(QualityNotificationStatus qualityNotificationStatus) { - return jpaInvestigationRepository.countAllByStatusEquals(NotificationStatusBaseEntity.valueOf(qualityNotificationStatus.name())); - } - @Override public Optional findByEdcNotificationId(String edcNotificationId) { return jpaInvestigationRepository.findByNotificationsEdcNotificationId(edcNotificationId) @@ -218,4 +205,9 @@ private List filterNotificationAssets(QualityNotificationMes .filter(it -> notificationAffectedAssetIds.contains(it.getId())) .toList(); } + + @Override + public List getDistinctFieldValues(String fieldName, String startWith, Integer resultLimit, QualityNotificationSide side) { + return CriteriaUtility.getDistinctNotificationFieldValues(fieldName, startWith, resultLimit, side, InvestigationEntity.class, entityManager); + } } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerAllIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerAllIT.java index dcf4c450d3..3e85d96ea7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerAllIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/AssetAsBuiltControllerAllIT.java @@ -76,7 +76,6 @@ void shouldReturnAssetsWithManufacturerName() throws JoseException { .body("content.manufacturerName", everyItem(not(equalTo(assetsSupport.emptyText())))); } - // Deprecated please remove once controller has been removed @Test void shoulReturnSupplierAssets() throws JoseException { //GIVEN @@ -94,7 +93,6 @@ void shoulReturnSupplierAssets() throws JoseException { .body("totalItems", equalTo(12)); } - // Deprecated please remove once controller has been removed @Test void shouldReturnOwnAssets() throws JoseException { //GIVEN 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 dad62f8dd2..5e772ed891 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 @@ -22,6 +22,7 @@ import io.restassured.http.ContentType; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; +import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -119,6 +120,68 @@ void givenNotEnumTypeFieldNameAndSizeAndOwnerOwn_whenCallDistinctFilterValues_th .body("size()", is(1)); } + @Test + void givenBusinessPartnerLowercase_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsStored(); + String fieldName = "businessPartner"; + String resultLimit = "100"; + String startWith = "bpnl"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", resultLimit) + .param("startWith", startWith) + .get("/api/assets/as-built/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder( + "BPNL00000003AXS3", + "BPNL00000003AYRE", + "BPNL00000003B0Q0", + "BPNL00000003B2OM", + "BPNL00000003B3NX", + "BPNL00000003B5MJ")); + } + + @Test + void givenBusinessPartnerMixedCase_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsStored(); + String fieldName = "businessPartner"; + String resultLimit = "100"; + String startWith = "bpNl"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", resultLimit) + .param("startWith", startWith) + .get("/api/assets/as-built/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder( + "BPNL00000003AXS3", + "BPNL00000003AYRE", + "BPNL00000003B0Q0", + "BPNL00000003B2OM", + "BPNL00000003B3NX", + "BPNL00000003B5MJ")); + } + @Test void givenNotExistentOwnerEnumValue_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { // given @@ -144,6 +207,27 @@ void givenNotExistentOwnerEnumValue_whenCallDistinctFilterValues_thenProperRespo .body("size()", is(1)); } + @Test + void givenIdFieldNameAndNoResultLimit_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsStored(); + String fieldName = "id"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .get("/api/assets/as-built/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body("size()", is(13)); + } + @Test void givenNotEnumTypeFieldNameAndSizeAndOwnerSupplier_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { // given 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 3ccefaf9d8..78154dc50b 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 @@ -23,6 +23,7 @@ import org.eclipse.tractusx.traceability.assets.infrastructure.asplanned.repository.JpaAssetAsPlannedRepository; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; +import org.hamcrest.Matchers; import org.jose4j.lang.JoseException; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -95,6 +96,79 @@ void givenNotEnumTypeFieldNameAndSizeAndOwnerOwn_whenCallDistinctFilterValues_th .body("size()", is(1)); } + @Test + void givenNotEnumTypeFieldNameAndOwnerOwn_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsAsPlannedStored(); + String fieldName = "id"; + String owner = "OWN"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("owner", owner) + .get("/api/assets/as-planned/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body("size()", is(1)); + } + + @Test + void givenIdShortLowerCase_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsAsPlannedStored(); + String fieldName = "idShort"; + String startWith = "vehicle"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("startWith", startWith) + .get("/api/assets/as-planned/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder( + "VehicleModelA", + "VehicleModelB")); + } + + @Test + void givenIdShortMixedCase_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + assetsSupport.defaultAssetsAsPlannedStored(); + String fieldName = "idShort"; + String startWith = "vehicleMODEL"; + + // then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("startWith", startWith) + .get("/api/assets/as-planned/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder( + "VehicleModelA", + "VehicleModelB")); + } + @Test void givenWrongOwnerEnum_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { // given diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java index 3e2c8f55e2..3d83ae1783 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AlertNotificationsSupport.java @@ -151,6 +151,7 @@ private void storeCreatedAlerts() { .id("1") .alert(alert1) .status(NotificationStatusBaseEntity.CREATED) + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .severity(QualityNotificationSeverity.MINOR) .targetDate(monthFromNow.minus(3L, DAYS)) @@ -159,6 +160,7 @@ private void storeCreatedAlerts() { .build(), AlertNotificationEntity .builder() + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) .status(NotificationStatusBaseEntity.SENT) @@ -172,6 +174,7 @@ private void storeCreatedAlerts() { .builder() .status(NotificationStatusBaseEntity.RECEIVED) .id("3") + .sendTo(OWN_BPN) .createdBy(OTHER_BPN) .severity(QualityNotificationSeverity.CRITICAL) .targetDate(monthFromNow.minus(1L, DAYS)) @@ -294,6 +297,7 @@ private void storeReceivedAlerts() { .builder() .id("11") .alert(alert1) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a11") .build(), @@ -301,6 +305,7 @@ private void storeReceivedAlerts() { .builder() .id("22") .alert(alert2) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a22") .build(), @@ -308,6 +313,7 @@ private void storeReceivedAlerts() { .builder() .id("33") .alert(alert3) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a33") .build(), @@ -315,6 +321,7 @@ private void storeReceivedAlerts() { .builder() .id("44") .alert(alert4) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.DECLINED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a44") .build(), @@ -322,6 +329,7 @@ private void storeReceivedAlerts() { .builder() .id("55") .alert(alert5) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CANCELED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a55") .build(), @@ -329,6 +337,7 @@ private void storeReceivedAlerts() { .builder() .id("66") .alert(alert6) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CLOSED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a66") .build() diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java index 942f3ce61d..75d6799a69 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/InvestigationNotificationsSupport.java @@ -158,6 +158,7 @@ private void storeCreatedInvestigations() { .investigation(investigation1) .status(NotificationStatusBaseEntity.CREATED) .severity(QualityNotificationSeverity.MINOR) + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .targetDate(monthFromNow.minus(3L, DAYS)) .createdByName(OWN_BPN_COMPANY_NAME) @@ -165,6 +166,7 @@ private void storeCreatedInvestigations() { .build(), InvestigationNotificationEntity .builder() + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) .status(NotificationStatusBaseEntity.SENT) @@ -180,6 +182,7 @@ private void storeCreatedInvestigations() { .id("3") .severity(QualityNotificationSeverity.CRITICAL) .targetDate(monthFromNow.minus(1L, DAYS)) + .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) .investigation(investigation3) @@ -191,6 +194,7 @@ private void storeCreatedInvestigations() { .id("4") .targetDate(monthFromNow) .severity(QualityNotificationSeverity.LIFE_THREATENING) + .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) .investigation(investigation4) @@ -202,6 +206,7 @@ private void storeCreatedInvestigations() { .severity(QualityNotificationSeverity.MINOR) .id("5") .targetDate(monthFromNow) + .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) .investigation(investigation5) @@ -213,6 +218,7 @@ private void storeCreatedInvestigations() { .severity(QualityNotificationSeverity.MAJOR) .targetDate(monthFromNow.plus(1L, DAYS)) .id("6") + .sendTo(OTHER_BPN) .createdBy(OTHER_BPN) .createdByName(OTHER_BPN_COMPANY_NAME) .investigation(investigation6) @@ -222,6 +228,7 @@ private void storeCreatedInvestigations() { .builder() .status(NotificationStatusBaseEntity.CANCELED) .id("7") + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .targetDate(monthFromNow.plus(2L, DAYS)) .severity(QualityNotificationSeverity.CRITICAL) @@ -235,6 +242,7 @@ private void storeCreatedInvestigations() { .severity(QualityNotificationSeverity.LIFE_THREATENING) .targetDate(monthFromNow.plus(3L, DAYS)) .id("8") + .sendTo(OTHER_BPN) .createdBy(OWN_BPN) .createdByName(OWN_BPN_COMPANY_NAME) .investigation(investigation8) @@ -301,6 +309,7 @@ private void storeReceivedInvestigations() { .builder() .id("11") .investigation(investigation1) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.RECEIVED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a11") .build(), @@ -308,6 +317,7 @@ private void storeReceivedInvestigations() { .builder() .id("22") .investigation(investigation2) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACKNOWLEDGED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a22") .build(), @@ -315,6 +325,7 @@ private void storeReceivedInvestigations() { .builder() .id("33") .investigation(investigation3) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.ACCEPTED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a33") .build(), @@ -322,6 +333,7 @@ private void storeReceivedInvestigations() { .builder() .id("44") .investigation(investigation4) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.DECLINED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a44") .build(), @@ -336,6 +348,7 @@ private void storeReceivedInvestigations() { .builder() .id("66") .investigation(investigation6) + .createdBy(OTHER_BPN) .status(NotificationStatusBaseEntity.CLOSED) .edcNotificationId("cda2d956-fa91-4a75-bb4a-8e5ba39b268a66") .build() diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java index d1f5d9ff1d..ef4281d50b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterIT.java @@ -20,7 +20,6 @@ package org.eclipse.tractusx.traceability.integration.qualitynotification.alert; import io.restassured.http.ContentType; -import org.checkerframework.checker.units.qual.A; 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; @@ -294,6 +293,55 @@ void givenInvestigations_whenProvideFilterCreatedByName_thenReturnAllCritical() .body("content", Matchers.hasSize(4)); } + @Test + void givenInvestigations_whenProvideFilterSendTo_thenReturnExpectedResults() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String filterString = "sendTo,STARTS_WITH,B,AND"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .param("page", "0") + .param("size", "10") + .contentType(ContentType.JSON) + .when() + .param("filter", filterString) + .get("/api/alerts") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(3)) + .body("content", Matchers.hasSize(3)); + } + + @Test + void givenInvestigations_whenProvideFilterSendToSort_thenReturnExpectedResults() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String filterString = "sendTo,STARTS_WITH,B,AND"; + String sortString = "sendTo,ASC"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .param("page", "0") + .param("size", "10") + .contentType(ContentType.JSON) + .when() + .param("filter", filterString) + .param("sort", sortString) + .get("/api/alerts") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(3)) + .body("content", Matchers.hasSize(3)) + .body("content.sendTo", Matchers.containsInRelativeOrder("BPNL00000001OWN", "BPNL00000002OTHER", "BPNL00000002OTHER")); + } + @Test void givenAlerts_whenGetAlertsByAssetId_thenReturnOnlyRelatedAlerts() throws JoseException { // Given diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java new file mode 100644 index 0000000000..994f128a68 --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/alert/AlertControllerFilterValuesIT.java @@ -0,0 +1,425 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.integration.qualitynotification.alert; + +import io.restassured.http.ContentType; +import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.AlertNotificationsSupport; +import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; +import org.hamcrest.Matchers; +import org.jose4j.lang.JoseException; +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; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; +import java.util.stream.Stream; + +import static io.restassured.RestAssured.given; +import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; + +class AlertControllerFilterValuesIT extends IntegrationTestSpecification { + + @Autowired + AlertsSupport alertsSupport; + + @Autowired + AlertNotificationsSupport alertNotificationsSupport; + + @Test + void givenDescriptionField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "description"; + final Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1", "11", "2", "22", "3", "33", "4", "44", "5", "55", "6", "7", "8").toArray())); + } + + + @Test + void givenDescriptionFieldStartWith_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1", "11").toArray())); + } + + @Test + void givenDescriptionFieldStartWithAndReceiver_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + final String channel = "RECEIVER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .param("channel", channel) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("11").toArray())); + } + + @Test + void givenDescriptionFieldStartWithAndSender_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + final String channel = "SENDER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .param("channel", channel) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1").toArray())); + } + + @Test + void givenBpnField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "bpn"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenBpnFieldStartWithCaseInsensitive1_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "bpn"; + final Integer size = 200; + final String startWith = "bpnl"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenBpnFieldStartWithCaseInsensitive2_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "bpn"; + final Integer size = 200; + final String startWith = "bpNl"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedDateField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "createdDate"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of( + "2023-10-07 10:10:10", + "2023-10-08 10:10:10", + "2023-10-09 10:10:10", + "2023-10-10 10:10:10", + "2023-10-10 10:10:11", + "2023-10-10 10:10:30", + "2023-10-11 10:10:10", + "2023-10-12 10:10:10", + "2023-10-13 10:10:10").toArray())); + } + + @Test + void givenCreatedDateFieldAndNoSize_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "createdDate"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of( + "2023-10-07 10:10:10", + "2023-10-08 10:10:10", + "2023-10-09 10:10:10", + "2023-10-10 10:10:10", + "2023-10-10 10:10:11", + "2023-10-10 10:10:30", + "2023-10-11 10:10:10", + "2023-10-12 10:10:10", + "2023-10-13 10:10:10").toArray())); + } + + @Test + void givenCreatedByField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedByFieldAndSender_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + final String channel = "SENDER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("channel", channel) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedByFieldAndReceiver_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + alertNotificationsSupport.defaultAlertsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + final String channel = "RECEIVER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("channel", channel) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000002OTHER").toArray())); + } + + @ParameterizedTest + @MethodSource("enumFieldNamesTestProvider") + void givenEnumTypeFields_whenCallDistinctFilterValues_thenProperResponse( + String fieldName, + Integer resultLimit, + List expectedResult + ) throws JoseException { + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", resultLimit.toString()) + .get("/api/alerts/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(expectedResult.toArray())); + } + + private static Stream enumFieldNamesTestProvider() { + return Stream.of( + Arguments.of("status", 10, List.of( + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + )), + Arguments.of("channel", 200, List.of( + "SENDER", + "RECEIVER" + )), + Arguments.of("severity", 10, List.of( + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE_THREATENING" + )), + Arguments.of("status", 1, List.of( + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + )), + Arguments.of("channel", 1, List.of( + "SENDER", + "RECEIVER" + )), + Arguments.of("severity", 1, List.of( + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE_THREATENING" + )) + ); + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java index b288ff6fdd..602302134b 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterIT.java @@ -164,6 +164,54 @@ void givenInvestigations_whenTargetDateAtLocalDate_thenExpectedResult() throws J .body("content", Matchers.hasSize(2)); } + @Test + void givenInvestigations_whenSendToFilter_thenExpectedResult() throws JoseException { + // given + investigationNotificationSupport.defaultInvestigationsStored(); + String filterString = "sendTo,STARTS_WITH,B,AND"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .param("page", "0") + .param("size", "10") + .contentType(ContentType.JSON) + .when() + .param("filter", filterString) + .get("/api/investigations") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(8)) + .body("content", Matchers.hasSize(8)); + } + + @Test + void givenInvestigations_whenSendToFilterAndSort_thenExpectedResult() throws JoseException { + // given + investigationNotificationSupport.defaultInvestigationsStored(); + String filterString = "sendTo,STARTS_WITH,B,AND"; + String sortString = "sendTo,ASC"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .param("page", "0") + .param("size", "10") + .contentType(ContentType.JSON) + .when() + .param("filter", filterString) + .param("sort", sortString) + .get("/api/investigations") + .then() + .statusCode(200) + .body("page", Matchers.is(0)) + .body("pageSize", Matchers.is(10)) + .body("totalItems", Matchers.is(8)) + .body("content", Matchers.hasSize(8)); + } + @Test void givenInvestigations_whenProvideFilterWithSeverityCritical_thenReturnAllCritical() throws JoseException { // given diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java new file mode 100644 index 0000000000..4aab4e3cfe --- /dev/null +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/qualitynotification/investigation/InvestigationControllerFilterValuesIT.java @@ -0,0 +1,423 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.integration.qualitynotification.investigation; + +import io.restassured.http.ContentType; +import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; +import org.eclipse.tractusx.traceability.integration.common.support.InvestigationNotificationsSupport; +import org.eclipse.tractusx.traceability.integration.common.support.InvestigationsSupport; +import org.hamcrest.Matchers; +import org.jose4j.lang.JoseException; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; +import java.util.stream.Stream; + +import static io.restassured.RestAssured.given; +import static org.eclipse.tractusx.traceability.common.security.JwtRole.ADMIN; + +class InvestigationControllerFilterValuesIT extends IntegrationTestSpecification { + + @Autowired + InvestigationsSupport investigationsSupport; + + @Autowired + InvestigationNotificationsSupport investigationNotificationsSupport; + + @Test + void givenDescriptionField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "description"; + final Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1", "11", "2", "22", "3", "33", "4", "44", "5", "55", "6", "7", "8").toArray())); + } + + + @Test + void givenDescriptionFieldStartWith_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1", "11").toArray())); + } + + @Test + void givenDescriptionFieldStartWithAndReceiver_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + final String channel = "RECEIVER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .param("channel", channel) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("11").toArray())); + } + + @Test + void givenDescriptionFieldStartWithAndSender_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "description"; + final Integer size = 200; + final String startWith = "1"; + final String channel = "SENDER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .param("channel", channel) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("1").toArray())); + } + + @Test + void givenBpnField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "bpn"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenBpnFieldStartWithCaseInsensitive1_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "bpn"; + final Integer size = 200; + final String startWith = "bpnl"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenBpnFieldStartWithCaseInsensitive2_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "bpn"; + final Integer size = 200; + final String startWith = "bpNl"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("startWith", startWith) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedDateField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "createdDate"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of( + "2023-10-07 10:10:10", + "2023-10-08 10:10:10", + "2023-10-09 10:10:10", + "2023-10-10 10:10:10", + "2023-10-10 10:10:30", + "2023-10-11 10:10:10", + "2023-10-12 10:10:10", + "2023-10-13 10:10:10").toArray())); + } + + @Test + void givenCreatedDateFieldAndNoSize_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "createdDate"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of( + "2023-10-07 10:10:10", + "2023-10-08 10:10:10", + "2023-10-09 10:10:10", + "2023-10-10 10:10:10", + "2023-10-10 10:10:30", + "2023-10-11 10:10:10", + "2023-10-12 10:10:10", + "2023-10-13 10:10:10").toArray())); + } + + @Test + void givenCreatedByField_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedByFieldAndSender_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + final String channel = "SENDER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("channel", channel) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000001OWN", "BPNL00000002OTHER").toArray())); + } + + @Test + void givenCreatedByFieldAndReceiver_whenCallDistinctFilterValues_thenProperResponse() throws JoseException { + // given + investigationNotificationsSupport.defaultInvestigationsStored(); + final String fieldName = "createdBy"; + Integer size = 200; + final String channel = "RECEIVER"; + + // when/then + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", size) + .param("channel", channel) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(List.of("BPNL00000002OTHER").toArray())); + } + + @ParameterizedTest + @MethodSource("enumFieldNamesTestProvider") + void givenEnumTypeFields_whenCallDistinctFilterValues_thenProperResponse( + String fieldName, + Integer resultLimit, + List expectedResult + ) throws JoseException { + given() + .header(oAuth2Support.jwtAuthorization(ADMIN)) + .contentType(ContentType.JSON) + .log().all() + .when() + .param("fieldName", fieldName) + .param("size", resultLimit.toString()) + .get("/api/investigations/distinctFilterValues") + .then() + .log().all() + .statusCode(200) + .assertThat() + .body(".", Matchers.containsInRelativeOrder(expectedResult.toArray())); + } + + private static Stream enumFieldNamesTestProvider() { + return Stream.of( + Arguments.of("status", 10, List.of( + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + )), + Arguments.of("channel", 200, List.of( + "SENDER", + "RECEIVER" + )), + Arguments.of("severity", 10, List.of( + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE_THREATENING" + )), + Arguments.of("status", 1, List.of( + "CREATED", + "SENT", + "RECEIVED", + "ACKNOWLEDGED", + "ACCEPTED", + "DECLINED", + "CANCELED", + "CLOSED" + )), + Arguments.of("channel", 1, List.of( + "SENDER", + "RECEIVER" + )), + Arguments.of("severity", 1, List.of( + "MINOR", + "MAJOR", + "CRITICAL", + "LIFE_THREATENING" + )) + ); + } +} diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java index f7d6865704..8d90ce270c 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/qualitynotification/domain/investigation/service/InvestigationServiceImplTest.java @@ -18,11 +18,9 @@ ********************************************************************************/ package org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.service; -import org.eclipse.tractusx.traceability.common.model.PageResult; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.InvestigationRepository; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotification; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationId; -import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationSide; import org.eclipse.tractusx.traceability.qualitynotification.domain.base.model.QualityNotificationStatus; import org.eclipse.tractusx.traceability.qualitynotification.domain.investigation.model.exception.InvestigationNotFoundException; import org.eclipse.tractusx.traceability.testdata.InvestigationTestDataFactory; @@ -31,10 +29,7 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import java.util.List; import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; @@ -73,39 +68,6 @@ void testFindExistingInvestigation() { assertThat(investigation).isNotNull(); } - @Test - void testFindCreatedInvestigations() { - // given - when(investigationsRepositoryMock.findQualityNotificationsBySide(any(QualityNotificationSide.class), any(Pageable.class))).thenReturn(new PageResult<>( - List.of( - InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationSide.SENDER), - InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationSide.SENDER) - ))); - - // expect - PageResult result = investigationService.getCreated(PageRequest.of(0, 5)); - - // then - assertThat(result).isNotNull(); - assertThat(result.content()).hasSize(2); - } - - @Test - void testFindReceivedInvestigations() { - // given - when(investigationsRepositoryMock.findQualityNotificationsBySide(any(QualityNotificationSide.class), any(Pageable.class))).thenReturn(new PageResult<>( - List.of( - InvestigationTestDataFactory.createInvestigationTestData(QualityNotificationSide.RECEIVER) - ))); - - // expect - PageResult result = investigationService.getReceived(PageRequest.of(0, 5)); - - // then - assertThat(result).isNotNull(); - assertThat(result.content()).hasSize(1); - } - @Test void testLoadNotPresentInvestigationThrowsException() { // given diff --git a/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSideParamRequest.java b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSideParamRequest.java new file mode 100644 index 0000000000..aac02db82a --- /dev/null +++ b/tx-models/src/main/java/qualitynotification/base/request/QualityNotificationSideParamRequest.java @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package qualitynotification.base.request; + +import io.swagger.annotations.ApiModel; + +@ApiModel(description = "Describes the side of quality notification") +public enum QualityNotificationSideParamRequest { + SENDER, + RECEIVER +} diff --git a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSideResponse.java b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSideResponse.java index c9c7d62454..f2f2551b86 100644 --- a/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSideResponse.java +++ b/tx-models/src/main/java/qualitynotification/base/response/QualityNotificationSideResponse.java @@ -23,7 +23,5 @@ @ApiModel(description = "Describes the side of quality notification") public enum QualityNotificationSideResponse { SENDER, - RECEIVER; - - + RECEIVER }