From c5cfbd3c4a63ae3c2917f745f3410433fa061021 Mon Sep 17 00:00:00 2001 From: arolfes Date: Wed, 19 Jun 2024 08:23:55 +0200 Subject: [PATCH] Closes #2486: Conversion to open api doc --- .../sql/sample-data/classification.sql | 2 +- .../sql/sample-data/task-comment.sql | 2 +- .../main/resources/sql/sample-data/task.sql | 2 +- pom.xml | 1 + rest/taskana-rest-spring-example-boot/pom.xml | 5 + .../example/boot/OpenApiConfiguration.java | 368 +++++ .../security/BootWebSecurityConfigurer.java | 3 +- .../src/main/resources/application.properties | 1 + rest/taskana-rest-spring/pom.xml | 6 +- .../rest/ClassificationController.java | 148 +- .../ClassificationDefinitionController.java | 46 +- .../ClassificationQueryFilterParameter.java | 126 ++ .../ClassificationRepresentationModel.java | 13 + ...cationSummaryPagedRepresentationModel.java | 2 + ...ssificationSummaryRepresentationModel.java | 64 +- .../common/rest/AccessIdController.java | 72 + .../common/rest/QueryPagingParameter.java | 15 + .../common/rest/QuerySortParameter.java | 13 + .../common/rest/TaskanaEngineController.java | 141 ++ .../CustomAttributesRepresentationModel.java | 5 + .../common/rest/models/PageMetadata.java | 13 + .../rest/models/PagedRepresentationModel.java | 2 + .../TaskanaUserInfoRepresentationModel.java | 13 + .../models/VersionRepresentationModel.java | 5 +- .../monitor/rest/MonitorController.java | 204 ++- .../monitor/rest/ReportFilterParameter.java | 453 ++++++ ...iorityColumnHeaderRepresentationModel.java | 7 + .../models/ReportRepresentationModel.java | 19 + .../task/rest/TaskCommentController.java | 133 +- .../rest/TaskCommentQueryFilterParameter.java | 72 + .../pro/taskana/task/rest/TaskController.java | 614 +++++++- .../rest/TaskQueryFilterCustomFields.java | 566 +++++++ .../rest/TaskQueryFilterCustomIntFields.java | 488 ++++++ .../task/rest/TaskQueryFilterParameter.java | 1382 ++++++++++++++++- .../task/rest/TaskQueryGroupByParameter.java | 15 + .../AttachmentSummaryRepresentationModel.java | 11 + .../ObjectReferenceRepresentationModel.java | 14 + ...kCommentCollectionRepresentationModel.java | 2 + .../TaskCommentRepresentationModel.java | 8 + .../rest/models/TaskRepresentationModel.java | 6 + ...kSummaryCollectionRepresentationModel.java | 2 + .../TaskSummaryPagedRepresentationModel.java | 2 + .../TaskSummaryRepresentationModel.java | 92 +- .../pro/taskana/user/rest/UserController.java | 143 ++ .../UserCollectionRepresentationModel.java | 2 + .../rest/models/UserRepresentationModel.java | 19 + .../rest/WorkbasketAccessItemController.java | 51 +- ...kbasketAccessItemQueryFilterParameter.java | 34 + .../workbasket/rest/WorkbasketController.java | 315 +++- .../rest/WorkbasketDefinitionController.java | 52 +- .../rest/WorkbasketQueryFilterParameter.java | 83 + ...nTargetsCollectionRepresentationModel.java | 2 + ...cessItemCollectionRepresentationModel.java | 2 + ...ketAccessItemPagedRepresentationModel.java | 2 + ...rkbasketAccessItemRepresentationModel.java | 43 + ...finitionCollectionRepresentationModel.java | 2 + ...rkbasketDefinitionRepresentationModel.java | 6 + .../models/WorkbasketRepresentationModel.java | 10 + ...basketSummaryPagedRepresentationModel.java | 2 + .../WorkbasketSummaryRepresentationModel.java | 49 + 60 files changed, 5926 insertions(+), 49 deletions(-) create mode 100644 rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/OpenApiConfiguration.java diff --git a/common/taskana-common-data/src/main/resources/sql/sample-data/classification.sql b/common/taskana-common-data/src/main/resources/sql/sample-data/classification.sql index 1967f88e9f..45359eda67 100644 --- a/common/taskana-common-data/src/main/resources/sql/sample-data/classification.sql +++ b/common/taskana-common-data/src/main/resources/sql/sample-data/classification.sql @@ -52,7 +52,7 @@ INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000005', 'L INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000006', 'L110105' , 'CLI:100000000000000000000000000000000004', 'L11010' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Dynamik-Ausschluss' , 'Dynamik-Ausschluss' , 5 , 'P16D' , '' , 'VNR,RVNR,KOLVNR' , 'TEXT_2' , '' , '' , '' , '' , '' , '' ); INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000007', 'L110107' , 'CLI:100000000000000000000000000000000004', 'L11010' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Dynamik-Einschluss/Änd.' , 'Dynamik-Einschluss/Änd.' , 5 , 'P5D' , 'point0815' , 'VNR,RVNR,KOLVNR' , 'TEXT_1' , '' , '' , '' , '' , '' , '' ); INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000008', 'L12010' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gewährung-Policendarlehen' , 'Gewährung-Policendarlehen' , 1 , 'P1D' , '' , 'VNR,RVNR,KOLVNR' , '' , '' , '' , '' , '' , '' , '' ); -INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Zustimmungserklärung' , 'Zustimmungserklärung' , 2 , 'P2D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' ); +INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000009', 'L140101' , '' , '' , 'EXTERNAL' , 'TASK' , 'DOMAIN_A', TRUE ,'2018-02-01 12:00:00','2018-02-01 12:00:00', 'Zustimmungserklärung' , 'Zustimmungserklärung' , 2 , 'P2D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' ); INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000010', 'T2100' , '' , '' , 'MANUAL' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'T-Vertragstermin VERA' , 'T-Vertragstermin VERA' , 2 , 'P2D' , '' , 'VNR' , 'cust2' , 'cust3' , 'cust4' , 'cust5' , 'cust6' , 'cust7' , 'cust8' ); INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000011', 'T6310' , '' , '' , 'AUTOMATIC' , 'TASK' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'T-GUK Honorarrechnung erstellen', 'Unterstützungskasse Honorar wird fällig', 2 , 'P2D' , 'point0815' , 'VNR' , 'custom2' , 'custom3' , 'custom4' , 'custom5' , 'custom6' , 'custom7' , 'custom8' ); INSERT INTO CLASSIFICATION VALUES('CLI:100000000000000000000000000000000013', 'DOCTYPE_DEFAULT', '' , '' , 'EXTERNAL' , 'DOCUMENT' , 'DOMAIN_A', TRUE , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'EP allgemein' , 'EP allgemein' , 99 , 'P2000D' , '' , 'VNR' , '' , '' , '' , '' , '' , '' , '' ); diff --git a/common/taskana-common-data/src/main/resources/sql/sample-data/task-comment.sql b/common/taskana-common-data/src/main/resources/sql/sample-data/task-comment.sql index 60f822a579..2ea63f49a4 100644 --- a/common/taskana-common-data/src/main/resources/sql/sample-data/task-comment.sql +++ b/common/taskana-common-data/src/main/resources/sql/sample-data/task-comment.sql @@ -1,4 +1,4 @@ --- sample-data is used for rest tests and for the example application + -- sample-data is used for rest tests and for the example application -- TASK_COMMENT TABLE ( ID , TASK_ID , TEXTFIELD , CREATOR , CREATED , MODIFIED -- TaskComments for GetTaskCommentAccTest + UpdateTaskCommentAccTest diff --git a/common/taskana-common-data/src/main/resources/sql/sample-data/task.sql b/common/taskana-common-data/src/main/resources/sql/sample-data/task.sql index 62408eab84..45edf2d300 100644 --- a/common/taskana-common-data/src/main/resources/sql/sample-data/task.sql +++ b/common/taskana-common-data/src/main/resources/sql/sample-data/task.sql @@ -4,7 +4,7 @@ INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000000', 'ETI:000000000000000000000000000000000000', RELATIVE_DATE(-1) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-1) , RELATIVE_DATE(0) , 'Task99' , 'creator_user_id' , 'Lorem ipsum was n Quatsch dolor sit amet.', 'Some custom Note' , 1 , -1 , 'CLAIMED' , 'MANUAL' , 'T2000' , 'CLI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , 'custom1' , 'custom2' , 'custom3' , 'custom4' , 'custom5' , 'custom6' , 'custom7' , 'custom8' , 'custom9' , 'custom10' , 'custom11' , 'custom12' , 'custom13' , 'abc' , 'custom15' , 'custom16' , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000001', 'ETI:000000000000000000000000000000000001', RELATIVE_DATE(-2) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , null , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Task01' , 'creator_user_id' , 'Lorem ipsum was n Quatsch dolor sit amet.', 'Some custom Note' , 2 , -1 , 'CLAIMED' , 'EXTERN' , 'L110102' , 'CLI:100000000000000000000000000000000005', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , 'pqr' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000002', 'ETI:000000000000000000000000000000000002', RELATIVE_DATE(-2) , RELATIVE_DATE(0) , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Task02' , 'creator_user_id' , 'Lorem ipsum was n Quatsch t. Aber stimmt.', 'Some custom Note' , 2 , -1 , 'CLAIMED' , 'MANUAL' , 'T2000' , 'CLI:100000000000000000000000000000000016', 'WBI:100000000000000000000000000000000006' , 'USER-1-1' , 'DOMAIN_A', 'BPI21' , 'PBPI21' , 'user-1-1' , 'MyCompany1', 'MySystem1', 'MyInstance1' , 'MyType1', 'MyValue1' , true , false , null , 'NONE' , null , null , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); -INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000003', 'ETI:000000000000000000000000000000000003', RELATIVE_DATE(-2) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000003' , 'DOC_0000000000000000003' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , 'efg' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); +INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000003', 'ETI:000000000000000000000000000000000003','2018-02-01 12:00:00', null , null , '2018-02-01 12:00:00', RELATIVE_DATE(0) , RELATIVE_DATE(-2) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000003' , 'DOC_0000000000000000003' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , 'efg' , null , null , null , null , null , null , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000004', 'ETI:000000000000000000000000000000000004', RELATIVE_DATE(-3) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000004' , 'DOC_0000000000000000004' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , 'ade' , null , null , null , '074' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000005', 'ETI:000000000000000000000000000000000005', RELATIVE_DATE(-4) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(-4) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000005' , 'DOC_0000000000000000005' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , null , null , null , null , '074' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); INSERT INTO TASK VALUES('TKI:000000000000000000000000000000000006', 'ETI:000000000000000000000000000000000006', RELATIVE_DATE(-5) , null , null , RELATIVE_DATE(0) , RELATIVE_DATE(-3) , RELATIVE_DATE(-5) , RELATIVE_DATE(0) , 'Widerruf' , 'creator_user_id' , 'Widerruf' , null , 2000 , -1 , 'READY' , 'EXTERN' , 'L1050' , 'CLI:100000000000000000000000000000000003', 'WBI:100000000000000000000000000000000001' , 'GPK_KSC' , 'DOMAIN_A', 'PI_0000000000006' , 'DOC_0000000000000000006' , null , '00' , 'PASystem' , '00' , 'VNR' , '11223344' , false , false , null , 'NONE' , null , null , null , null , null , null , '075' , '' , null , null , null , null , null , null , 'abc' , null , null , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ); diff --git a/pom.xml b/pom.xml index 209211007e..74c1cd1872 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,7 @@ 3.0.1 2.0.11 1.20.0 + 2.5.0 1.15.0 diff --git a/rest/taskana-rest-spring-example-boot/pom.xml b/rest/taskana-rest-spring-example-boot/pom.xml index 943c49aa8c..4f99a38036 100644 --- a/rest/taskana-rest-spring-example-boot/pom.xml +++ b/rest/taskana-rest-spring-example-boot/pom.xml @@ -50,6 +50,11 @@ taskana-rest-spring-example-common ${project.version} + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${version.spring-openapi} + diff --git a/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/OpenApiConfiguration.java b/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/OpenApiConfiguration.java new file mode 100644 index 0000000000..c18dba37d5 --- /dev/null +++ b/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/OpenApiConfiguration.java @@ -0,0 +1,368 @@ +package pro.taskana.example.boot; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ObjectSchema; +import io.swagger.v3.oas.models.media.StringSchema; +import java.util.List; +import java.util.Map; +import org.springdoc.core.customizers.OpenApiCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@OpenAPIDefinition( + info = + @Info( + title = "TASKANA RESTful API Documentation", + version = "8.2.0", + description = + "" + + "

Overview

" + + "

" + + "This is the REST documentation for [TASKANA](http://taskana.pro) - the " + + "world’s first open source solution for Enterprise Task Management." + + "

" + + "

" + + "**For all Query Parameters:**
Whenever a parameter is an array type," + + " several values can be passed by declaring that parameter multiple times." + + "

" + + "

" + + "Whenever a parameter is a complex type, the attributes of the value-object" + + " can be passed as a json. For example, a complex parameter with the name " + + "\"complex-query-param\" and attributes \"attribute1\" and \"attribute2\" " + + "would be specified in the following way:complex-query-param={\"attribute1\"" + + ":\"value1\",\"attribute2\":\"value2\"}" + + "

" + + "

" + + "Whenever a parameter is a value-less type (e.g owner-is-null and " + + "current-user) it is expected to be defined without a value, i.e., it should" + + " be specified as ?parameter and not ?parameter= or ?parameter=someValue" + + "

" + + "

Hypermedia Support

" + + "

" + + "NOTE: HATEOAS support is still in development.Please have a look at " + + "example responses for each resource to determine the available links." + + "

" + + "

" + + "TASKANA uses the [HATEOAS](https://restfulapi.net/hateoas/) (Hypermedia" + + " as the Engine of Application State) REST constraint. Most of our resources" + + " contain a _links section which contains navigation links. Besides, helping" + + " to navigate through our REST API, the navigation links also encapsulate the" + + " API. Using HATEOAS allows us to change some endpoints without modifying " + + "your frontend." + + "

" + + "

Errors

" + + "

" + + "In order to support multilingual websites, TASKANA uses error codes to " + + "define which error occurred. Additionally, an optional set of message " + + "variables, containing some technical information, is added, so that the " + + "website can describe the error with all details." + + "

" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
Status CodeKeyMessage Variables
**400 BAD_REQUEST**CLASSIFICATION_SERVICE_LEVEL_MALFORMEDserviceLevel, classificationKey, domain
**400 BAD_REQUEST**CUSTOM_HOLIDAY_WRONG_FORMATcustomHoliday
**400 BAD_REQUEST**DOMAIN_NOT_FOUNDdomain
**400 BAD_REQUEST**INVALID_ARGUMENT
**400 BAD_REQUEST**QUERY_PARAMETER_MALFORMEDmalformedQueryParameters
**400 BAD_REQUEST**TASK_INVALID_CALLBACK_STATEtaskId, taskCallbackState, requiredCallbackStates
**400 BAD_REQUEST**TASK_INVALID_OWNERtaskId, currentUserId
**400 BAD_REQUEST**TASK_INVALID_STATEtaskId, taskState, requiredTaskStates
**403 FORBIDDEN**NOT_AUTHORIZEDroles, currentUserId
**403 FORBIDDEN**NOT_AUTHORIZED_ON_TASK_COMMENTcurrentUserId, taskCommentId
**403 FORBIDDEN**NOT_AUTHORIZED_ON_WORKBASKET_WITH_IDcurrentUserId, workbasketId, requiredPermissions
**403 FORBIDDEN**NOT_AUTHORIZED_ON_WORKBASKET_WITH_KEY_AND_DOMAINcurrentUserId, workbasketKey, domain, requiredPermissions
**404 NOT_FOUND**CLASSIFICATION_WITH_ID_NOT_FOUNDclassificationId
**404 NOT_FOUND**CLASSIFICATION_WITH_KEY_NOT_FOUNDclassificationKey, domain
**404 NOT_FOUND**TASK_COMMENT_NOT_FOUNDtaskCommentId
**404 NOT_FOUND**TASK_NOT_FOUNDtaskId
**404 NOT_FOUND**USER_NOT_FOUNDuserId
**404 NOT_FOUND**WORKBASKET_WITH_ID_NOT_FOUNDworkbasketId
**404 NOT_FOUND**WORKBASKET_WITH_KEY_NOT_FOUNDworkbasketKey, domain
**409 CONFLICT**ATTACHMENT_ALREADY_EXISTSattachmentId, taskId
**409 CONFLICT**CLASSIFICATION_ALREADY_EXISTSclassificationKey, domain
**409 CONFLICT**ENTITY_NOT_UP_TO_DATEentityId
**409 CONFLICT**TASK_ALREADY_EXISTSexternalTaskId
**409 CONFLICT**USER_ALREADY_EXISTSuserID
**409 CONFLICT**WORKBASKET_ACCESS_ITEM_ALREADY_EXISTSaccessId, workbasketId
**409 CONFLICT**WORKBASKET_ALREADY_EXISTSworkbasketKey, domain
**409 CONFLICT**WORKBASKET_MARKED_FOR_DELETIONworkbasketId
**413 PAYLOAD_TOO_LARGE**PAYLOAD_TOO_LARGE
**423 LOCKED**CLASSIFICATION_IN_USEclassificationKey, domain
**423 LOCKED**WORKBASKET_IN_USEworkbasketId
**500 INTERNAL_SERVER_ERROR**CONNECTION_AUTOCOMMIT_FAILED
**500 INTERNAL_SERVER_ERROR**CONNECTION_NOT_SET
**500 INTERNAL_SERVER_ERROR**CRITICAL_SYSTEM_ERROR
**500 INTERNAL_SERVER_ERROR**DATABASE_UNSUPPORTEDdatabaseProductName
**500 INTERNAL_SERVER_ERROR**UNKNOWN_ERROR
" + + "

Errors

" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
KeyType
accessIdString
attachmentIdString
classificationIdString
classificationKeyString
currentUserIdString
customHolidayString
databaseProductNameString
domainString
externalTaskIdString
historyEventIdString
malformedQueryParametersMalformedQueryParameter[]
requiredCallbackStatesCallbackState[]
requiredPermissionsWorkbasketPermission[]
requiredTaskStatesTaskState[]
rolesTaskanaRole[]
taskCallbackStateCallbackState
taskCommentIdString
taskIdString
taskStateTaskState
workbasketIdString
workbasketKeyString
")) +public class OpenApiConfiguration { + @Bean + public OpenApiCustomizer openApiCustomizer() { + return openApi -> { + ArraySchema arraySchema = new ArraySchema().items(new StringSchema()); + + // Define the ObjectSchema for the map with String keys and Array of Strings as values + ObjectSchema mapSchema = + (ObjectSchema) + new ObjectSchema() + .additionalProperties(arraySchema) + .name("TypeMapSchema") + .example( + Map.of( + "key1", + List.of("value1", "value2"), + "key2", + List.of("value3", "value4"))); + + // Add the schema to the components + var schemas = openApi.getComponents().getSchemas(); + schemas.put(mapSchema.getName(), mapSchema); + }; + } +} diff --git a/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/security/BootWebSecurityConfigurer.java b/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/security/BootWebSecurityConfigurer.java index 9ba7089b58..a7b0becd85 100644 --- a/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/security/BootWebSecurityConfigurer.java +++ b/rest/taskana-rest-spring-example-boot/src/main/java/pro/taskana/example/boot/security/BootWebSecurityConfigurer.java @@ -73,7 +73,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { authorizeHttpRequests .requestMatchers("/css/**", "/img/**") .permitAll() - .requestMatchers(HttpMethod.GET, "/docs/**") + .requestMatchers( + HttpMethod.GET, "/docs/**", "/api-docs*") .permitAll()) .cors(Customizer.withDefaults()) .addFilter(jaasApiIntegrationFilter()) diff --git a/rest/taskana-rest-spring-example-boot/src/main/resources/application.properties b/rest/taskana-rest-spring-example-boot/src/main/resources/application.properties index 915da08e51..a7aff6af69 100644 --- a/rest/taskana-rest-spring-example-boot/src/main/resources/application.properties +++ b/rest/taskana-rest-spring-example-boot/src/main/resources/application.properties @@ -7,6 +7,7 @@ taskana.routing.dmn.upload.path=/tmp/routing.dmn spring.datasource.url=jdbc:h2:mem:taskana;NON_KEYWORDS=KEY,VALUE;IGNORECASE=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_MODE=0 spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa +springdoc.api-docs.path=/api-docs spring.datasource.password=sa taskana.schemaName=TASKANA ######## h2 console configuration ######## diff --git a/rest/taskana-rest-spring/pom.xml b/rest/taskana-rest-spring/pom.xml index 701348f77b..5402e3ce25 100644 --- a/rest/taskana-rest-spring/pom.xml +++ b/rest/taskana-rest-spring/pom.xml @@ -78,7 +78,11 @@ org.springframework.boot spring-boot-autoconfigure - + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${version.spring-openapi} + pro.taskana diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java index 70b663444b..3158751679 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationController.java @@ -1,9 +1,16 @@ package pro.taskana.classification.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.beans.ConstructorProperties; import java.util.List; import java.util.function.BiConsumer; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; @@ -71,13 +78,29 @@ public class ClassificationController { * @param pagingParameter the paging parameters * @return the classifications with the given filter, sort and paging options. */ + @Operation( + summary = "Get a list of all Classifications", + description = + "This endpoint retrieves a list of existing Classifications. Filters can be applied.", + responses = { + @ApiResponse( + responseCode = "200", + description = "the classifications with the given filter, sort and paging options.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = ClassificationSummaryPagedRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_CLASSIFICATIONS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getClassifications( HttpServletRequest request, - final ClassificationQueryFilterParameter filterParameter, - final ClassificationQuerySortParameter sortParameter, - final QueryPagingParameter pagingParameter) { + @ParameterObject final ClassificationQueryFilterParameter filterParameter, + @ParameterObject final ClassificationQuerySortParameter sortParameter, + @ParameterObject + final QueryPagingParameter pagingParameter) { QueryParamsValidator.validateParams( request, @@ -103,6 +126,26 @@ public ResponseEntity getClassifi * @throws ClassificationNotFoundException if the requested classification is not found. * @title Get a single Classification */ + @Operation( + summary = "Get a single Classification", + description = "This endpoint retrieves a single Classification.", + parameters = { + @Parameter( + name = "classificationId", + description = "the Id of the requested Classification.", + example = "CLI:100000000000000000000000000000000009", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the requested classification", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ClassificationRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID, produces = MediaTypes.HAL_JSON_VALUE) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getClassification( @@ -127,6 +170,35 @@ public ResponseEntity getClassification( * @throws MalformedServiceLevelException if the {@code serviceLevel} property does not comply * * with the ISO 8601 specification */ + @Operation( + summary = "Create a new Classification", + description = "This endpoint creates a new Classification.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the Classification which should be created.", + content = + @Content( + schema = @Schema(implementation = ClassificationRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"key\" : \"Key0815casdgdgh\",\n" + + " \"domain\" : \"DOMAIN_B\",\n" + + " \"priority\" : 0,\n" + + " \"serviceLevel\" : \"P1D\",\n" + + " \"type\" : \"TASK\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "201", + description = "The inserted Classification", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ClassificationRepresentationModel.class)) + }) + }) @PostMapping(path = RestEndpoints.URL_CLASSIFICATIONS) @Transactional(rollbackFor = Exception.class) public ResponseEntity createClassification( @@ -157,6 +229,61 @@ public ResponseEntity createClassification( * @throws MalformedServiceLevelException if the {@code serviceLevel} property does not comply * * with the ISO 8601 specification */ + @Operation( + summary = "Update a Classification", + description = "This endpoint updates a Classification.", + parameters = { + @Parameter( + name = "classificationId", + description = "the Id of the Classification which should be updated.", + example = "CLI:100000000000000000000000000000000009", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the new Classification for the requested id.", + content = + @Content( + schema = @Schema(implementation = ClassificationRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"classificationId\" : " + + "\"CLI:100000000000000000000000000000000009\",\n" + + " \"key\" : \"L140101\",\n" + + " \"applicationEntryPoint\" : \"\",\n" + + " \"category\" : \"EXTERNAL\",\n" + + " \"domain\" : \"DOMAIN_A\",\n" + + " \"name\" : \"new name\",\n" + + " \"parentId\" : \"\",\n" + + " \"parentKey\" : \"\",\n" + + " \"priority\" : 2,\n" + + " \"serviceLevel\" : \"P2D\",\n" + + " \"type\" : \"TASK\",\n" + + " \"custom1\" : \"VNR\",\n" + + " \"custom2\" : \"\",\n" + + " \"custom3\" : \"\",\n" + + " \"custom4\" : \"\",\n" + + " \"custom5\" : \"\",\n" + + " \"custom6\" : \"\",\n" + + " \"custom7\" : \"\",\n" + + " \"custom8\" : \"\",\n" + + " \"isValidInDomain\" : true,\n" + + " \"created\" : \"2018-02-01T12:00:00.000Z\",\n" + + " \"modified\" : \"2018-02-01T12:00:00.000Z\",\n" + + " \"description\" : \"Zustimmungserklärung\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the updated Classification", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ClassificationRepresentationModel.class)) + }) + }) @PutMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity updateClassification( @@ -191,6 +318,21 @@ public ResponseEntity updateClassification( * Classification * @throws NotAuthorizedException if the user is not authorized to delete a Classification */ + @Operation( + summary = "Delete a Classification", + description = "This endpoint deletes a requested Classification if possible.", + parameters = { + @Parameter( + name = "classificationId", + description = "the requested Classification Id which should be deleted", + example = "CLI:100000000000000000000000000000000010", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "204", + content = {@Content(schema = @Schema())}) + }) @DeleteMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity deleteClassification( diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationDefinitionController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationDefinitionController.java index 1a284f2723..20f3530fe4 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationDefinitionController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationDefinitionController.java @@ -3,6 +3,11 @@ import static pro.taskana.common.internal.util.CheckedFunction.wrap; import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -13,7 +18,9 @@ import java.util.Set; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; @@ -65,6 +72,22 @@ public class ClassificationDefinitionController { * @param domain Filter the export by domain * @return the configured Classifications. */ + @Operation( + summary = "Export Classifications", + description = "This endpoint exports all configured Classifications.", + parameters = {@Parameter(name = "domain", description = "Filter the export by domain")}, + responses = { + @ApiResponse( + responseCode = "200", + description = "the configured Classifications.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = + ClassificationDefinitionCollectionRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_CLASSIFICATION_DEFINITIONS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity @@ -102,7 +125,28 @@ public class ClassificationDefinitionController { * @throws MalformedServiceLevelException if the {@code serviceLevel} property does not comply * * with the ISO 8601 specification */ - @PostMapping(path = RestEndpoints.URL_CLASSIFICATION_DEFINITIONS) + @Operation( + summary = "Import Classifications", + description = + "This endpoint imports all Classifications. Existing Classifications will not be removed." + + " Existing Classifications with the same key/domain will be overridden.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = + "the file containing the Classifications which should be imported. To get an " + + "example file containing the Classificatioins, go to the " + + "[TASKANA UI](http://localhost:8080/taskana/index.html) and export the " + + "Classifications", + required = true, + content = @Content(mediaType = MediaType.MULTIPART_FORM_DATA_VALUE)), + responses = { + @ApiResponse( + responseCode = "204", + content = {@Content(schema = @Schema())}) + }) + @PostMapping( + path = RestEndpoints.URL_CLASSIFICATION_DEFINITIONS, + consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @Transactional(rollbackFor = Exception.class) public ResponseEntity importClassifications(@RequestParam("file") MultipartFile file) throws InvalidArgumentException, diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationQueryFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationQueryFilterParameter.java index 5261a88190..3f573535e3 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationQueryFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/ClassificationQueryFilterParameter.java @@ -4,6 +4,7 @@ import static pro.taskana.common.internal.util.CheckedConsumer.wrap; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Optional; import java.util.stream.Stream; @@ -15,7 +16,66 @@ public class ClassificationQueryFilterParameter implements QueryParameter { + public String[] getName() { + return name; + } + + public String[] getNameLike() { + return nameLike; + } + + public String[] getKey() { + return key; + } + + public String[] getCategory() { + return category; + } + + public String[] getDomain() { + return domain; + } + + public String[] getType() { + return type; + } + + public String[] getCustom1Like() { + return custom1Like; + } + + public String[] getCustom2Like() { + return custom2Like; + } + + public String[] getCustom3Like() { + return custom3Like; + } + + public String[] getCustom4Like() { + return custom4Like; + } + + public String[] getCustom5Like() { + return custom5Like; + } + + public String[] getCustom6Like() { + return custom6Like; + } + + public String[] getCustom7Like() { + return custom7Like; + } + + public String[] getCustom8Like() { + return custom8Like; + } + /** Filter by the name of the Classification. This is an exact match. */ + @Schema( + name = "name", + description = "Filter by the name of the Classification. This is an exact match.") @JsonProperty("name") private final String[] name; @@ -24,22 +84,40 @@ public class ClassificationQueryFilterParameter * the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "name-like", + description = + "Filter by the name of the Classification. This results in a substring search. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("name-like") private final String[] nameLike; /** Filter by the key of the Classification. This is an exact match. */ + @Schema( + name = "key", + description = "Filter by the key of the Classification. This is an exact match.") @JsonProperty("key") private final String[] key; /** Filter by the category of the Classification. This is an exact match. */ + @Schema( + name = "category", + description = "Filter by the category of the Classification. This is an exact match.") @JsonProperty("category") private final String[] category; /** Filter by the domain of the Classification. This is an exact match. */ + @Schema( + name = "domain", + description = "Filter by the domain of the Classification. This is an exact match.") @JsonProperty("domain") private final String[] domain; /** Filter by the type of the Classification. This is an exact match. */ + @Schema( + name = "type", + description = "Filter by the type of the Classification. This is an exact match.") @JsonProperty("type") private final String[] type; @@ -48,6 +126,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-1-like", + description = + "Filter by the value of the field custom1. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-1-like") private final String[] custom1Like; @@ -56,6 +140,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-2-like", + description = + "Filter by the value of the field custom2. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-2-like") private final String[] custom2Like; @@ -64,6 +154,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-3-like", + description = + "Filter by the value of the field custom3. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-3-like") private final String[] custom3Like; @@ -72,6 +168,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-4-like", + description = + "Filter by the value of the field custom4. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-4-like") private final String[] custom4Like; @@ -80,6 +182,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-5-like", + description = + "Filter by the value of the field custom5. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-5-like") private final String[] custom5Like; @@ -88,6 +196,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-6-like", + description = + "Filter by the value of the field custom6. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-6-like") private final String[] custom6Like; /** @@ -95,6 +209,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-7-like", + description = + "Filter by the value of the field custom7. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-7-like") private final String[] custom7Like; @@ -103,6 +223,12 @@ public class ClassificationQueryFilterParameter * to the beginning and end of the requested value). Further SQL "LIKE" wildcard characters will * be resolved correctly. */ + @Schema( + name = "custom-8-like", + description = + "Filter by the value of the field custom8. This results in a substring search.. (% is " + + "appended to the beginning and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-8-like") private final String[] custom8Like; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationRepresentationModel.java index b12f5291a3..e3e1900003 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.classification.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.Instant; import pro.taskana.classification.api.models.Classification; @@ -7,20 +8,32 @@ public class ClassificationRepresentationModel extends ClassificationSummaryRepresentationModel { /** True, if this classification to objects in this domain. */ + @Schema( + name = "isValidInDomain", + description = "True, if this classification to objects in this domain.") private Boolean isValidInDomain; /** * The creation timestamp of the classification in the system. * *

The format is ISO-8601. */ + @Schema( + name = "created", + description = + "The creation timestamp of the classification in the system.

The format is ISO-8601.") private Instant created; /** * The timestamp of the last modification. * *

The format is ISO-8601. */ + @Schema( + name = "modified", + description = "The timestamp of the last modification.

The format is ISO-8601." + ) private Instant modified; /** The description of the classification. */ + @Schema(name = "description", description = "The description of the classification.") private String description; public Boolean getIsValidInDomain() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryPagedRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryPagedRepresentationModel.java index 5dd36f520f..32c7fe74a4 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryPagedRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryPagedRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.classification.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import java.beans.ConstructorProperties; import java.util.Collection; @@ -17,6 +18,7 @@ public ClassificationSummaryPagedRepresentationModel( } /** the embedded classifications. */ + @Schema(name = "classifications", description = "the embedded classifications.") @Override @JsonProperty("classifications") public @NotNull Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryRepresentationModel.java index d7a40c41f4..5b5f71d622 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/classification/rest/models/ClassificationSummaryRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.classification.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import org.springframework.hateoas.RepresentationModel; import pro.taskana.classification.api.models.ClassificationSummary; @@ -9,55 +10,106 @@ public class ClassificationSummaryRepresentationModel extends RepresentationModel { /** Unique Id. */ - @NotNull protected String classificationId; + @Schema(name = "classificationId", description = "Unique Id.") + @NotNull + protected String classificationId; /** * The key of the Classification. This is typically an externally known code or abbreviation of * the Classification. */ - @NotNull protected String key; + @Schema( + name = "key", + description = + "The key of the Classification. This is typically an externally known code or " + + "abbreviation of the Classification.") + @NotNull + protected String key; /** * The logical name of the entry point. This is needed by the task list application to determine * the redirect to work on a task of this Classification. */ + @Schema( + name = "applicationEntryPoint", + description = + "The logical name of the entry point. This is needed by the task list application to " + + "determine the redirect to work on a task of this Classification.") protected String applicationEntryPoint; /** * The category of the classification. Categories can be configured in the file * 'taskana.properties'. */ - @NotNull protected String category; + @Schema( + name = "category", + description = + "The category of the classification. Categories can be configured in the file " + + "'taskana.properties'.") + @NotNull + protected String category; /** The domain for which this classification is specified. */ + @Schema(name = "domain", description = "The domain for which this classification is specified.") protected String domain; /** The name of the classification. */ - @NotNull protected String name; + @Schema(name = "name", description = "The name of the classification.") + @NotNull + protected String name; /** The Id of the parent classification. Empty string ("") if this is a root classification. */ + @Schema( + name = "parentId", + description = + "The Id of the parent classification. Empty string (\"\") if this is a root " + + "classification.") protected String parentId; /** The key of the parent classification. Empty string ("") if this is a root classification. */ + @Schema( + name = "parentKey", + description = + "The key of the parent classification. Empty string (\"\") if this is a root " + + "classification.") protected String parentKey; /** The priority of the classification. */ - @NotNull protected int priority; + @Schema(name = "priority", description = "The priority of the classification.") + @NotNull + protected int priority; /** * The service level of the classification. * *

This is stated according to ISO 8601. */ - @NotNull protected String serviceLevel; + @Schema( + name = "serviceLevel", + description = + "The service level of the classification.

This is stated according to ISO 8601.") + @NotNull + protected String serviceLevel; /** The type of classification. Types can be configured in the file 'taskana.properties'. */ + @Schema( + name = "type", + description = + "The type of classification. Types can be configured in the file 'taskana.properties'.") protected String type; /** A custom property with name "1". */ + @Schema(name = "custom1", description = "A custom property with name \"1\".") protected String custom1; /** A custom property with name "2". */ + @Schema(name = "custom2", description = "A custom property with name \"2\".") protected String custom2; /** A custom property with name "3". */ + @Schema(name = "custom3", description = "A custom property with name \"3\".") protected String custom3; /** A custom property with name "4". */ + @Schema(name = "custom4", description = "A custom property with name \"4\".") protected String custom4; /** A custom property with name "5". */ + @Schema(name = "custom5", description = "A custom property with name \"5\".") protected String custom5; /** A custom property with name "6". */ + @Schema(name = "custom6", description = "A custom property with name \"6\".") protected String custom6; /** A custom property with name "7". */ + @Schema(name = "custom7", description = "A custom property with name \"7\".") protected String custom7; /** A custom property with name "8". */ + @Schema(name = "custom8", description = "A custom property with name \"8\".") protected String custom8; public String getClassificationId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/AccessIdController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/AccessIdController.java index e6cc5ca098..fd14a33f98 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/AccessIdController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/AccessIdController.java @@ -1,8 +1,14 @@ package pro.taskana.common.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.List; import javax.naming.InvalidNameException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; import org.springframework.http.ResponseEntity; @@ -41,6 +47,25 @@ public AccessIdController(LdapClient ldapClient, TaskanaEngine taskanaEngine) { * @throws InvalidNameException if name is not a valid dn. * @title Search for Access Id (users and groups and permissions) */ + @Operation( + summary = "Search for Access Id (users and groups)", + description = "This endpoint searches a provided access Id in the configured ldap.", + parameters = { + @Parameter( + name = "search-for", + description = "the Access Id which should be searched for.", + example = "max", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "a list of all found Access Ids", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = AccessIdRepresentationModel[].class))) + }) @GetMapping(path = RestEndpoints.URL_ACCESS_ID) public ResponseEntity> searchUsersAndGroupsAndPermissions( @RequestParam("search-for") String searchFor) @@ -67,6 +92,34 @@ public ResponseEntity> searchUsersAndGroupsAnd * or ADMIN * @title Search for Access Id (users) in TASKANA user role */ + @Operation( + summary = "Search for Access Id (users) in TASKANA user role", + description = + "This endpoint searches AccessIds for a provided name or Access Id. It will only search " + + "and return users and members of groups which are configured with the requested " + + "TASKANA role. This search will only work if the users in the configured LDAP have" + + " an attribute that shows their group memberships, e.g. \"memberOf\"", + parameters = { + @Parameter( + name = "search-for", + description = "the name or Access Id which should be searched for.", + example = "user-1", + required = true), + @Parameter( + name = "role", + description = "the role for which all users should be searched for", + example = "user", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "a list of all found Access Ids (users)", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = AccessIdRepresentationModel[].class))) + }) @GetMapping(path = RestEndpoints.URL_ACCESS_ID_WITH_NAME) public ResponseEntity> searchUsersByNameOrAccessIdForRole( @RequestParam("search-for") String nameOrAccessId, @RequestParam("role") String role) @@ -94,6 +147,25 @@ public ResponseEntity> searchUsersByNameOrAcce * @throws InvalidNameException if name is not a valid dn. * @title Get groups for Access Id */ + @Operation( + summary = "Get groups for Access Id", + description = "This endpoint retrieves all groups a given Access Id belongs to.", + parameters = { + @Parameter( + name = "access-id", + description = "the Access Id whose groups should be determined.", + example = "teamlead-1", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "a list of the group Access Ids the requested Access Id belongs to", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = AccessIdRepresentationModel[].class))) + }) @GetMapping(path = RestEndpoints.URL_ACCESS_ID_GROUPS) public ResponseEntity> getGroupsByAccessId( @RequestParam("access-id") String accessId) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QueryPagingParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QueryPagingParameter.java index 1d6b1a299e..03a0ff56c7 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QueryPagingParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QueryPagingParameter.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Min; import java.beans.ConstructorProperties; import java.util.List; @@ -11,12 +12,26 @@ public class QueryPagingParameter> implements QueryParameter> { + public Integer getPage() { + return page; + } + + public Integer getPageSize() { + return pageSize; + } + /** Request a specific page. Requires the definition of the 'page-size'. */ + @Schema( + name = "page", + description = "Request a specific page. Requires the definition of the 'page-size'.") @JsonProperty("page") @Min(1) private final Integer page; /** Defines the size for each page. This requires a specific requested 'page'. */ + @Schema( + name = "page-size", + description = "Defines the size for each page. This requires a specific requested 'page'.") @JsonProperty("page-size") @Min(1) private final Integer pageSize; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QuerySortParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QuerySortParameter.java index 76aa1aed6d..318dcc40d9 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QuerySortParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/QuerySortParameter.java @@ -1,6 +1,7 @@ package pro.taskana.common.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import pro.taskana.common.api.BaseQuery; import pro.taskana.common.api.BaseQuery.SortDirection; @@ -12,6 +13,11 @@ public class QuerySortParameter, S extends QuerySortBy // the javadoc comment for this field is above its getter. This is done to define the type // parameter S by overriding that getter and allowing spring-auto-rest-docs to properly detect // the type parameter S. + @Schema( + name = "sort-by", + description = + "Sort the result by a given field. Multiple sort values can be declared. When the " + + "primary sort value is the same, the second one will be used.") @JsonProperty("sort-by") private final List sortBy; @@ -20,6 +26,13 @@ public class QuerySortParameter, S extends QuerySortBy * of sort-by and order declarations have to match. Alternatively the value can be omitted. If * done so the default sort order (ASCENDING) will be applied to every sort-by value. */ + @Schema( + name = "order", + description = + "The order direction for each sort value. This value requires the use of 'sort-by'. The" + + " amount of sort-by and order declarations have to match. Alternatively the value" + + " can be omitted. If done so the default sort order (ASCENDING) will be applied to" + + " every sort-by value.") @JsonProperty("order") private final List order; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/TaskanaEngineController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/TaskanaEngineController.java index 61e369ee5c..83a62bd762 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/TaskanaEngineController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/TaskanaEngineController.java @@ -1,8 +1,15 @@ package pro.taskana.common.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; @@ -46,6 +53,16 @@ public class TaskanaEngineController { * * @return An array with the domain-names as strings */ + @Operation( + summary = "This endpoint retrieves all configured Domains.", + responses = + @ApiResponse( + responseCode = "200", + description = "An array with the domain-names as strings", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = String[].class)))) @GetMapping(path = RestEndpoints.URL_DOMAIN) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity> getDomains() { @@ -60,6 +77,24 @@ public ResponseEntity> getDomains() { * classification categories will be returned. * @return the classification categories for the requested type. */ + @Operation( + summary = + "This endpoint retrieves the configured classification categories for a specific " + + "classification type.", + parameters = + @Parameter( + name = "type", + description = + "The classification type whose categories should be determined. If not specified " + + "all classification categories will be returned."), + responses = + @ApiResponse( + responseCode = "200", + description = "The classification categories for the requested type.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = String[].class)))) @GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity> getClassificationCategories( @@ -75,6 +110,16 @@ public ResponseEntity> getClassificationCategories( * * @return the configured classification types. */ + @Operation( + summary = "This endpoint retrieves the configured classification types.", + responses = + @ApiResponse( + responseCode = "200", + description = "The configured classification types.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = String[].class)))) @GetMapping(path = RestEndpoints.URL_CLASSIFICATION_TYPES) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity> getClassificationTypes() { @@ -87,6 +132,18 @@ public ResponseEntity> getClassificationTypes() { * * @return the configured classification categories */ + @Operation( + summary = + "This endpoint retrieves all configured classification categories grouped by each " + + "classification type.", + responses = + @ApiResponse( + responseCode = "200", + description = "The configured classification categories.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(ref = "#/components/schemas/TypeMapSchema")))) @GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES_BY_TYPES) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity>> getClassificationCategoriesByTypeMap() { @@ -98,6 +155,16 @@ public ResponseEntity>> getClassificationCategoriesByTy * * @return the information of the current user. */ + @Operation( + summary = "This endpoint computes all information of the current user.", + responses = + @ApiResponse( + responseCode = "200", + description = "The information of the current user.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskanaUserInfoRepresentationModel.class)))) @GetMapping(path = RestEndpoints.URL_CURRENT_USER) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getCurrentUserInfo() { @@ -115,6 +182,16 @@ public ResponseEntity getCurrentUserInfo() { * * @return true, when the history is enabled, otherwise false */ + @Operation( + summary = "This endpoint checks if the history module is in use.", + responses = + @ApiResponse( + responseCode = "200", + description = "True, when the history is enabled, otherwise false", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = Boolean.class)))) @GetMapping(path = RestEndpoints.URL_HISTORY_ENABLED) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getIsHistoryProviderEnabled() { @@ -127,6 +204,18 @@ public ResponseEntity getIsHistoryProviderEnabled() { * @title Get custom configuration * @return custom configuration */ + @Operation( + summary = "Get custom configuration", + description = "This endpoint retrieves the saved custom configuration.", + responses = + @ApiResponse( + responseCode = "200", + description = "The custom configuration.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = CustomAttributesRepresentationModel.class)))) @GetMapping(path = RestEndpoints.URL_CUSTOM_ATTRIBUTES) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getCustomAttributes() { @@ -141,6 +230,48 @@ public ResponseEntity getCustomAttributes() * @title Set all custom configuration * @return the new custom configuration */ + @Operation( + summary = "Set all custom configuration", + description = "This endpoint overrides the custom configuration.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "The new custom configuration", + required = true, + content = + @Content( + schema = @Schema(implementation = CustomAttributesRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"customAttributes\": {\n" + + " \"schema\": {\n" + + " \"Filter\": {\n" + + " \"displayName\": " + + "\"Filter for Task-Priority-Report\",\n" + + " \"members\": {\n" + + " \"filter\": {\n" + + " \"displayName\": \"Filter values\",\n" + + " \"type\": \"json\",\n" + + " \"min\": \"1\"\n" + + " }\n" + + " }\n" + + " },\n" + + " \"filter\": \"{ \\\"Tasks with state READY\\\": " + + "{ \\\"state\\\": [\\\"READY\\\"]}, \\\"Tasks with state " + + "CLAIMED\\\": {\\\"state\\\": [\\\"CLAIMED\\\"] }}\"\n" + + " }\n" + + " }\n" + + "}"))), + responses = + @ApiResponse( + responseCode = "200", + description = "The new custom configuration.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = CustomAttributesRepresentationModel.class)))) @PutMapping(path = RestEndpoints.URL_CUSTOM_ATTRIBUTES) @Transactional(rollbackFor = Exception.class) public ResponseEntity setCustomAttributes( @@ -154,6 +285,16 @@ public ResponseEntity setCustomAttributes( * * @return The current version. */ + @Operation( + summary = "Get the current application version", + responses = + @ApiResponse( + responseCode = "200", + description = "The current version.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = VersionRepresentationModel.class)))) @GetMapping(path = RestEndpoints.URL_VERSION) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity currentVersion() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/CustomAttributesRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/CustomAttributesRepresentationModel.java index 142874b9d7..957a3390f2 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/CustomAttributesRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/CustomAttributesRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.common.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Map; import org.springframework.hateoas.RepresentationModel; @@ -8,6 +9,10 @@ public class CustomAttributesRepresentationModel extends RepresentationModel { /** The custom configuration attributes. */ + @Schema( + name = "customAttributes", + description = "The custom configuration attributes." + ) private final Map customAttributes; @ConstructorProperties({"customAttributes"}) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PageMetadata.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PageMetadata.java index e36968d3dd..b0052cac64 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PageMetadata.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PageMetadata.java @@ -1,5 +1,7 @@ package pro.taskana.common.rest.models; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Objects; @@ -11,12 +13,23 @@ public class PageMetadata { /** The element size of the page. */ + @Parameter(hidden = true) + @Schema(name = "size", description = "The element size of the page.") private final long size; + /** The total number of elements available. */ + @Parameter(hidden = true) + @Schema(name = "totalElements", description = "The total number of elements available.") private final long totalElements; + /** Amount of pages that are available in total. */ + @Parameter(hidden = true) + @Schema(name = "totalPages", description = "Amount of pages that are available in total.") private final long totalPages; + /** The current page number. */ + @Parameter(hidden = true) + @Schema(name = "number", description = "The current page number.") private final long number; @ConstructorProperties({"size", "totalElements", "totalPages", "number"}) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PagedRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PagedRepresentationModel.java index 061880ce30..47acd0f402 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PagedRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/PagedRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.common.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import org.springframework.hateoas.RepresentationModel; @@ -8,6 +9,7 @@ public abstract class PagedRepresentationModel { /** the page meta data for a paged request. */ + @Schema(name = "page", description = "the page meta data for a paged request.") @JsonProperty("page") private final PageMetadata pageMetadata; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/TaskanaUserInfoRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/TaskanaUserInfoRepresentationModel.java index 2cc397982e..c024c9864e 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/TaskanaUserInfoRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/TaskanaUserInfoRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.common.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; import org.springframework.hateoas.RepresentationModel; @@ -11,10 +12,22 @@ public class TaskanaUserInfoRepresentationModel extends RepresentationModel { /** The user Id of the current user. */ + @Schema( + name = "userId", + description = "The user Id of the current user." + ) private String userId; /** All groups the current user is a member of. */ + @Schema( + name = "groupIds", + description = "All groups the current user is a member of." + ) private List groupIds = new ArrayList<>(); /** All permissions the current user has. */ + @Schema( + name = "roles", + description = "All permissions the current user has." + ) private List roles = new ArrayList<>(); public String getUserId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/VersionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/VersionRepresentationModel.java index fc34866eb7..ba08b8320b 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/VersionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/models/VersionRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.common.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import org.springframework.hateoas.RepresentationModel; import org.springframework.lang.NonNull; @@ -8,7 +9,9 @@ public class VersionRepresentationModel extends RepresentationModel { /** The current TASKANA version of the REST Service. */ - @NotNull private String version; + @Schema(name = "version", description = "The current TASKANA version of the REST Service.") + @NotNull + private String version; public String getVersion() { return version; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/MonitorController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/MonitorController.java index 1798d09372..34a5103877 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/MonitorController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/MonitorController.java @@ -1,9 +1,17 @@ package pro.taskana.monitor.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.util.Arrays; import java.util.List; import java.util.Optional; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -69,10 +77,36 @@ public class MonitorController { * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException TODO: this is never thrown ... */ + @Operation( + summary = "Compute a Workbasket Report", + description = + "This endpoint generates a Workbasket Report.

Each Row represents a Workbasket.

Each " + + "Column Header represents a Time Interval.", + parameters = { + @Parameter( + name = "task-timestamp", + description = "Determine which Task Timestamp should be used for comparison"), + @Parameter( + name = "state", + examples = { + @ExampleObject(value = "READY"), + @ExampleObject(value = "CLAIMED"), + @ExampleObject(value = "COMPLETED") + }) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))), + }) @GetMapping(path = RestEndpoints.URL_MONITOR_WORKBASKET_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeWorkbasketReport( - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp taskTimestamp) throws NotAuthorizedException, InvalidArgumentException { if (taskTimestamp == null) { @@ -104,10 +138,31 @@ public ResponseEntity computeWorkbasketReport( * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException if topicWorkbaskets or useDefaultValues are false */ + @Operation( + summary = "Compute a Workbasket Priority Report", + description = + "This endpoint generates a Workbasket Priority Report.

Each Row represents a " + + "Workbasket.

Each Column Header represents a priority range.", + parameters = { + @Parameter( + name = "workbasket-type", + description = "Determine the WorkbasketTypes to include in the report", + example = "GROUP"), + @Parameter(name = "columnHeader", description = "The column headers for the report") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_WORKBASKET_PRIORITY_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computePriorityWorkbasketReport( - PriorityReportFilterParameter filterParameter, + @ParameterObject PriorityReportFilterParameter filterParameter, @RequestParam(name = "workbasket-type", required = false) WorkbasketType[] workbasketTypes, @RequestParam(name = "columnHeader", required = false) PriorityColumnHeaderRepresentationModel[] columnHeaders) @@ -146,10 +201,29 @@ public ResponseEntity computePriorityWorkbasketReport * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException TODO: this is never thrown ... */ + @Operation( + summary = "Compute a Classification Category Report", + description = + "This endpoint generates a Classification Category Report.

Each Row represents a " + + "Classification category.

Each Column Header represents a Time Interval.", + parameters = { + @Parameter( + name = "task-timestamp", + description = "Determine which Task Timestamp should be used for comparison") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_CLASSIFICATION_CATEGORY_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeClassificationCategoryReport( - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp taskTimestamp) throws InvalidArgumentException, NotAuthorizedException { if (taskTimestamp == null) { @@ -181,10 +255,29 @@ public ResponseEntity computeClassificationCategoryRe * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException TODO: this is never thrown */ + @Operation( + summary = "Compute a Classification Report", + description = + "This endpoint generates a Classification Report.

Each Row represents a Classification." + + "

Each Column Header represents a Time Interval.", + parameters = { + @Parameter( + name = "task-timestamp", + description = "Determine which Task Timestamp should be used for comparison") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_CLASSIFICATION_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeClassificationReport( - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp taskTimestamp) throws NotAuthorizedException, InvalidArgumentException { if (taskTimestamp == null) { @@ -216,10 +309,30 @@ public ResponseEntity computeClassificationReport( * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException TODO: this is never thrown */ + @Operation( + summary = "Compute a Detailed Classification Report", + description = + "This endpoint generates a Detailed Classification Report.

Each Foldable Row represents" + + " a Classification and can be expanded to show the Classification of Attachments." + + "

Each Column Header represents a Time Interval.", + parameters = { + @Parameter( + name = "task-timestamp", + description = "Determine which Task Timestamp should be used for comparison") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_DETAILED_CLASSIFICATION_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeDetailedClassificationReport( - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp taskTimestamp) throws NotAuthorizedException, InvalidArgumentException { if (taskTimestamp == null) { @@ -251,11 +364,36 @@ public ResponseEntity computeDetailedClassificationRe * @throws NotAuthorizedException if the current user is not authorized to compute the Report * @throws InvalidArgumentException TODO: this is never thrown */ + @Operation( + summary = "Compute a Detailed Classification Report", + description = + "This endpoint generates a Task Custom Field Value Report.

Each Row represents a value " + + "of the requested Task Custom Field.

Each Column Header represents a Time " + + "Interval.", + parameters = { + @Parameter( + name = "custom-field", + description = "The Task Custom Field whose values are of interest", + example = "CUSTOM_14", + required = true), + @Parameter( + name = "task-timestamp", + description = "Determine which Task Timestamp should be used for comparison") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_TASK_CUSTOM_FIELD_VALUE_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeTaskCustomFieldValueReport( @RequestParam(name = "custom-field") TaskCustomField customField, - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp taskTimestamp) throws NotAuthorizedException, InvalidArgumentException { if (taskTimestamp == null) { @@ -288,6 +426,38 @@ public ResponseEntity computeTaskCustomFieldValueRepo * @return the computed Report * @throws NotAuthorizedException if the current user is not authorized to compute the Report */ + @Operation( + summary = "Compute a Task Status Report", + description = + "This endpoint generates a Task Status Report.

Each Row represents a Workbasket.

" + + "Each Column Header represents a Task State.", + parameters = { + @Parameter( + name = "domain", + description = "Filter the report values by domains", + required = false), + @Parameter( + name = "state", + description = "Filter the report values by Task states", + required = false), + @Parameter( + name = "workbasket-id", + description = "Filter the report values by Workbasket Ids", + required = false), + @Parameter( + name = "priority-minimum", + description = "Filter the report values by a minimum priority", + required = false) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_TASK_STATUS_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeTaskStatusReport( @@ -331,10 +501,30 @@ public ResponseEntity computeTaskStatusReport( * @throws NotAuthorizedException if the current user is not authorized to compute the report * @throws InvalidArgumentException TODO: this is never thrown */ + @Operation( + summary = "Compute a Timestamp Report", + description = + "This endpoint generates a Timestamp Report.

Each Foldable Row represents a " + + "TaskTimestamp and can be expanded to display the four organization levels of the " + + "corresponding Workbasket.

Each Column Header represents a TimeInterval.", + parameters = { + @Parameter( + name = "task-timestamp", + description = "Filter by the Task Timestamp of the task") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The computed Report", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = ReportRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_MONITOR_TIMESTAMP_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity computeTimestampReport( - TimeIntervalReportFilterParameter filterParameter, + @ParameterObject TimeIntervalReportFilterParameter filterParameter, @RequestParam(name = "task-timestamp", required = false) TaskTimestamp[] timestamps) throws NotAuthorizedException, InvalidArgumentException { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/ReportFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/ReportFilterParameter.java index 4e19a95993..157ace6230 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/ReportFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/ReportFilterParameter.java @@ -1,40 +1,281 @@ package pro.taskana.monitor.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import pro.taskana.task.api.TaskState; public class ReportFilterParameter { + public Boolean getInWorkingDays() { + return inWorkingDays; + } + + public String[] getWorkbasketId() { + return workbasketId; + } + + public TaskState[] getState() { + return state; + } + + public String[] getClassificationCategory() { + return classificationCategory; + } + + public String[] getDomain() { + return domain; + } + + public String[] getClassificationId() { + return classificationId; + } + + public String[] getExcludedClassificationId() { + return excludedClassificationId; + } + + public String[] getCustom1() { + return custom1; + } + + public String[] getCustom1Like() { + return custom1Like; + } + + public String[] getCustom1NotIn() { + return custom1NotIn; + } + + public String[] getCustom2() { + return custom2; + } + + public String[] getCustom2Like() { + return custom2Like; + } + + public String[] getCustom2NotIn() { + return custom2NotIn; + } + + public String[] getCustom3() { + return custom3; + } + + public String[] getCustom3Like() { + return custom3Like; + } + + public String[] getCustom3NotIn() { + return custom3NotIn; + } + + public String[] getCustom4() { + return custom4; + } + + public String[] getCustom4Like() { + return custom4Like; + } + + public String[] getCustom4NotIn() { + return custom4NotIn; + } + + public String[] getCustom5() { + return custom5; + } + + public String[] getCustom5Like() { + return custom5Like; + } + + public String[] getCustom5NotIn() { + return custom5NotIn; + } + + public String[] getCustom6() { + return custom6; + } + + public String[] getCustom6Like() { + return custom6Like; + } + + public String[] getCustom6NotIn() { + return custom6NotIn; + } + + public String[] getCustom7() { + return custom7; + } + + public String[] getCustom7Like() { + return custom7Like; + } + + public String[] getCustom7NotIn() { + return custom7NotIn; + } + + public String[] getCustom8() { + return custom8; + } + + public String[] getCustom8Like() { + return custom8Like; + } + + public String[] getCustom8NotIn() { + return custom8NotIn; + } + + public String[] getCustom9() { + return custom9; + } + + public String[] getCustom9Like() { + return custom9Like; + } + + public String[] getCustom9NotIn() { + return custom9NotIn; + } + + public String[] getCustom10() { + return custom10; + } + + public String[] getCustom10Like() { + return custom10Like; + } + + public String[] getCustom10NotIn() { + return custom10NotIn; + } + + public String[] getCustom11() { + return custom11; + } + + public String[] getCustom11Like() { + return custom11Like; + } + + public String[] getCustom11NotIn() { + return custom11NotIn; + } + + public String[] getCustom12() { + return custom12; + } + + public String[] getCustom12Like() { + return custom12Like; + } + + public String[] getCustom12NotIn() { + return custom12NotIn; + } + + public String[] getCustom13() { + return custom13; + } + + public String[] getCustom13Like() { + return custom13Like; + } + + public String[] getCustom13NotIn() { + return custom13NotIn; + } + + public String[] getCustom14() { + return custom14; + } + + public String[] getCustom14Like() { + return custom14Like; + } + + public String[] getCustom14NotIn() { + return custom14NotIn; + } + + public String[] getCustom15() { + return custom15; + } + + public String[] getCustom15Like() { + return custom15Like; + } + + public String[] getCustom15NotIn() { + return custom15NotIn; + } + + public String[] getCustom16() { + return custom16; + } + + public String[] getCustom16Like() { + return custom16Like; + } + + public String[] getCustom16NotIn() { + return custom16NotIn; + } /** Determine weather the report should convert the age of the Tasks into working days. */ + @Schema( + name = "in-working-days", + description = + "Determine weather the report should convert the age of the Tasks into working days.") @JsonProperty("in-working-days") protected final Boolean inWorkingDays; /** Filter by workbasket id of the Task. This is an exact match. */ + @Schema( + name = "workbasket-id", + description = "Filter by workbasket id of the Task. This is an exact match.") @JsonProperty("workbasket-id") protected final String[] workbasketId; /** Filter by the task state. This is an exact match. */ + @Schema(name = "state", description = "Filter by the task state. This is an exact match.") @JsonProperty("state") protected final TaskState[] state; /** Filter by the classification category of the Task. This is an exact match. */ + @Schema( + name = "classification-category", + description = "Filter by the classification category of the Task. This is an exact match.") @JsonProperty("classification-category") protected final String[] classificationCategory; /** Filter by domain of the Task. This is an exact match. */ + @Schema(name = "domain", description = "Filter by domain of the Task. This is an exact match.") @JsonProperty("domain") protected final String[] domain; /** Filter by the classification id of the Task. This is an exact match. */ + @Schema( + name = "classification-id", + description = "Filter by the classification id of the Task. This is an exact match.") @JsonProperty("classification-id") protected final String[] classificationId; /** Filter by the classification id of the Task. This is an exact match. */ + @Schema( + name = "excluded-classification-id", + description = "Filter by the classification id of the Task. This is an exact match.") @JsonProperty("excluded-classification-id") protected final String[] excludedClassificationId; /** Filter by the value of the field custom1 of the Task. This is an exact match. */ + @Schema( + name = "custom-1", + description = "Filter by the value of the field custom1 of the Task. This is an exact match.") @JsonProperty("custom-1") protected final String[] custom1; @@ -43,14 +284,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-1-like", + description = + "Filter by the custom1 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-1-like") protected final String[] custom1Like; /** Filter out by values of the field custom1 of the Task. This is an exact match. */ + @Schema( + name = "custom-1-not-in", + description = + "Filter out by values of the field custom1 of the Task. This is an exact match.") @JsonProperty("custom-1-not-in") protected final String[] custom1NotIn; /** Filter by the value of the field custom2 of the Task. This is an exact match. */ + @Schema( + name = "custom-2", + description = "Filter by the value of the field custom2 of the Task. This is an exact match.") @JsonProperty("custom-2") protected final String[] custom2; @@ -59,14 +313,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-2-like", + description = + "Filter by the custom2 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-2-like") protected final String[] custom2Like; /** Filter out by values of the field custom2 of the Task. This is an exact match. */ + @Schema( + name = "custom-2-not-in", + description = + "Filter out by values of the field custom2 of the Task. This is an exact match.") @JsonProperty("custom-2-not-in") protected final String[] custom2NotIn; /** Filter by the value of the field custom3 of the Task. This is an exact match. */ + @Schema( + name = "custom-3", + description = "Filter by the value of the field custom3 of the Task. This is an exact match.") @JsonProperty("custom-3") protected final String[] custom3; @@ -75,14 +342,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-3-like", + description = + "Filter by the custom3 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-3-like") protected final String[] custom3Like; /** Filter out by values of the field custom3 of the Task. This is an exact match. */ + @Schema( + name = "custom-3-not-in", + description = + "Filter out by values of the field custom3 of the Task. This is an exact match.") @JsonProperty("custom-3-not-in") protected final String[] custom3NotIn; /** Filter by the value of the field custom4 of the Task. This is an exact match. */ + @Schema( + name = "custom-4", + description = "Filter by the value of the field custom4 of the Task. This is an exact match.") @JsonProperty("custom-4") protected final String[] custom4; @@ -91,14 +371,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-4-like", + description = + "Filter by the custom4 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-4-like") protected final String[] custom4Like; /** Filter out by values of the field custom4 of the Task. This is an exact match. */ + @Schema( + name = "custom-4-not-in", + description = + "Filter out by values of the field custom4 of the Task. This is an exact match.") @JsonProperty("custom-4-not-in") protected final String[] custom4NotIn; /** Filter by the value of the field custom5 of the Task. This is an exact match. */ + @Schema( + name = "custom-5", + description = "Filter by the value of the field custom5 of the Task. This is an exact match.") @JsonProperty("custom-5") protected final String[] custom5; @@ -107,14 +400,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-5-like", + description = + "Filter by the custom5 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-5-like") protected final String[] custom5Like; /** Filter out by values of the field custom5 of the Task. This is an exact match. */ + @Schema( + name = "custom-5-not-in", + description = + "Filter out by values of the field custom5 of the Task. This is an exact match.") @JsonProperty("custom-5-not-in") protected final String[] custom5NotIn; /** Filter by the value of the field custom6 of the Task. This is an exact match. */ + @Schema( + name = "custom-6", + description = "Filter by the value of the field custom6 of the Task. This is an exact match.") @JsonProperty("custom-6") protected final String[] custom6; @@ -123,14 +429,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-6-like", + description = + "Filter by the custom6 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-6-like") protected final String[] custom6Like; /** Filter out by values of the field custom6 of the Task. This is an exact match. */ + @Schema( + name = "custom-6-not-in", + description = + "Filter out by values of the field custom6 of the Task. This is an exact match.") @JsonProperty("custom-6-not-in") protected final String[] custom6NotIn; /** Filter by the value of the field custom7 of the Task. This is an exact match. */ + @Schema( + name = "custom-7", + description = "Filter by the value of the field custom7 of the Task. This is an exact match.") @JsonProperty("custom-7") protected final String[] custom7; @@ -139,14 +458,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-7-like", + description = + "Filter by the custom7 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-7-like") protected final String[] custom7Like; /** Filter out by values of the field custom7 of the Task. This is an exact match. */ + @Schema( + name = "custom-7-not-in", + description = + "Filter out by values of the field custom7 of the Task. This is an exact match.") @JsonProperty("custom-7-not-in") protected final String[] custom7NotIn; /** Filter by the value of the field custom8 of the Task. This is an exact match. */ + @Schema( + name = "custom-8", + description = "Filter by the value of the field custom8 of the Task. This is an exact match.") @JsonProperty("custom-8") protected final String[] custom8; @@ -155,14 +487,27 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-8-like", + description = + "Filter by the custom8 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-8-like") protected final String[] custom8Like; /** Filter out by values of the field custom8 of the Task. This is an exact match. */ + @Schema( + name = "custom-8-not-in", + description = + "Filter out by values of the field custom8 of the Task. This is an exact match.") @JsonProperty("custom-8-not-in") protected final String[] custom8NotIn; /** Filter by the value of the field custom9 of the Task. This is an exact match. */ + @Schema( + name = "custom-9", + description = "Filter by the value of the field custom9 of the Task. This is an exact match.") @JsonProperty("custom-9") protected final String[] custom9; @@ -171,14 +516,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-9-like", + description = + "Filter by the custom9 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-9-like") protected final String[] custom9Like; /** Filter out by values of the field custom9 of the Task. This is an exact match. */ + @Schema( + name = "custom-9-not-in", + description = + "Filter out by values of the field custom9 of the Task. This is an exact match.") @JsonProperty("custom-9-not-in") protected final String[] custom9NotIn; /** Filter by the value of the field custom10 of the Task. This is an exact match. */ + @Schema( + name = "custom-10", + description = + "Filter by the value of the field custom10 of the Task. This is an exact match.") @JsonProperty("custom-10") protected final String[] custom10; @@ -187,14 +546,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-10-like", + description = + "Filter by the custom10 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-10-like") protected final String[] custom10Like; /** Filter out by values of the field custom10 of the Task. This is an exact match. */ + @Schema( + name = "custom-10-not-in", + description = + "Filter out by values of the field custom10 of the Task. This is an exact match.") @JsonProperty("custom-10-not-in") protected final String[] custom10NotIn; /** Filter by the value of the field custom11 of the Task. This is an exact match. */ + @Schema( + name = "custom-11", + description = + "Filter by the value of the field custom11 of the Task. This is an exact match.") @JsonProperty("custom-11") protected final String[] custom11; @@ -203,14 +576,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-11-like", + description = + "Filter by the custom11 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-11-like") protected final String[] custom11Like; /** Filter out by values of the field custom11 of the Task. This is an exact match. */ + @Schema( + name = "custom-11-not-in", + description = + "Filter out by values of the field custom11 of the Task. This is an exact match.") @JsonProperty("custom-11-not-in") protected final String[] custom11NotIn; /** Filter by the value of the field custom12 of the Task. This is an exact match. */ + @Schema( + name = "custom-12", + description = + "Filter by the value of the field custom12 of the Task. This is an exact match.") @JsonProperty("custom-12") protected final String[] custom12; @@ -219,14 +606,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-12-like", + description = + "Filter by the custom12 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-12-like") protected final String[] custom12Like; /** Filter out by values of the field custom12 of the Task. This is an exact match. */ + @Schema( + name = "custom-12-not-in", + description = + "Filter out by values of the field custom12 of the Task. This is an exact match.") @JsonProperty("custom-12-not-in") protected final String[] custom12NotIn; /** Filter by the value of the field custom13 of the Task. This is an exact match. */ + @Schema( + name = "custom-13", + description = + "Filter by the value of the field custom13 of the Task. This is an exact match.") @JsonProperty("custom-13") protected final String[] custom13; @@ -235,14 +636,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-13-like", + description = + "Filter by the custom13 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-13-like") protected final String[] custom13Like; /** Filter out by values of the field custom13 of the Task. This is an exact match. */ + @Schema( + name = "custom-13-not-in", + description = + "Filter out by values of the field custom13 of the Task. This is an exact match.") @JsonProperty("custom-13-not-in") protected final String[] custom13NotIn; /** Filter by the value of the field custom14 of the Task. This is an exact match. */ + @Schema( + name = "custom-14", + description = + "Filter by the value of the field custom14 of the Task. This is an exact match.") @JsonProperty("custom-14") protected final String[] custom14; @@ -251,14 +666,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-14-like", + description = + "Filter by the custom14 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-14-like") protected final String[] custom14Like; /** Filter out by values of the field custom14 of the Task. This is an exact match. */ + @Schema( + name = "custom-14-not-in", + description = + "Filter out by values of the field custom14 of the Task. This is an exact match.") @JsonProperty("custom-14-not-in") protected final String[] custom14NotIn; /** Filter by the value of the field custom15 of the Task. This is an exact match. */ + @Schema( + name = "custom-15", + description = + "Filter by the value of the field custom15 of the Task. This is an exact match.") @JsonProperty("custom-15") protected final String[] custom15; @@ -267,14 +696,28 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-15-like", + description = + "Filter by the custom15 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-15-like") protected final String[] custom15Like; /** Filter out by values of the field custom15 of the Task. This is an exact match. */ + @Schema( + name = "custom-15-not-in", + description = + "Filter out by values of the field custom15 of the Task. This is an exact match.") @JsonProperty("custom-15-not-in") protected final String[] custom15NotIn; /** Filter by the value of the field custom16 of the Task. This is an exact match. */ + @Schema( + name = "custom-16", + description = + "Filter by the value of the field custom16 of the Task. This is an exact match.") @JsonProperty("custom-16") protected final String[] custom16; @@ -283,10 +726,20 @@ public class ReportFilterParameter { * the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "custom-16-like", + description = + "Filter by the custom16 field of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("custom-16-like") protected final String[] custom16Like; /** Filter out by values of the field custom16 of the Task. This is an exact match. */ + @Schema( + name = "custom-16-not-in", + description = + "Filter out by values of the field custom16 of the Task. This is an exact match.") @JsonProperty("custom-16-not-in") protected final String[] custom16NotIn; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/PriorityColumnHeaderRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/PriorityColumnHeaderRepresentationModel.java index 3ef7918519..10a7a87a6d 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/PriorityColumnHeaderRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/PriorityColumnHeaderRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.monitor.rest.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import org.springframework.hateoas.RepresentationModel; @@ -9,9 +10,15 @@ public class PriorityColumnHeaderRepresentationModel extends RepresentationModel { /** Determine the lower priority for this column header. This value is inclusive. */ + @Schema( + name = "lowerBound", + description = "Determine the lower priority for this column header. This value is inclusive.") private final int lowerBound; /** Determine the upper priority for this column header. This value is inclusive. */ + @Schema( + name = "upperBound", + description = "Determine the upper priority for this column header. This value is inclusive.") private final int upperBound; @ConstructorProperties({"lowerBound", "upperBound"}) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/ReportRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/ReportRepresentationModel.java index 514ba505ae..98c4f644a3 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/ReportRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/models/ReportRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.monitor.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.time.Instant; import java.util.Arrays; @@ -12,10 +13,13 @@ public class ReportRepresentationModel extends RepresentationModel { /** Object holding meta info on the report. */ + @Schema(name = "meta", description = "Object holding meta info on the report.") private final MetaInformation meta; /** Array holding the rows of the report. */ + @Schema(name = "rows", description = "Array holding the rows of the report.") private final List rows; /** Array holding the sums in the columns over all rows. */ + @Schema(name = "sumRow", description = "Array holding the sums in the columns over all rows.") private final List sumRow; @ConstructorProperties({"meta", "rows", "sumRow"}) @@ -44,14 +48,24 @@ public List getSumRow() { public static class RowRepresentationModel { /** Array holding all the cell values of the given row. */ + @Schema(name = "cells", description = "Array holding all the cell values of the given row.") private final int[] cells; /** Sum of all values of the given row. */ + @Schema(name = "cells", description = "Sum of all values of the given row.") private final int total; /** Depth of the row. If the depth is > 0, then this row is a sub-row of a prior row */ + @Schema( + name = "depth", + description = + "Depth of the row. If the depth is > 0, then this row is a sub-row of a prior row") private final int depth; /** Array containing description of the row. */ + @Schema(name = "desc", description = "Array containing description of the row.") private final String[] desc; /** Boolean identifying if the given row should be initially displayed or not. */ + @Schema( + name = "display", + description = "Boolean identifying if the given row should be initially displayed or not.") private final boolean display; @ConstructorProperties({"cells", "total", "depth", "desc", "display"}) @@ -104,14 +118,19 @@ public String toString() { public static class MetaInformation { /** Name of the report. */ + @Schema(name = "name", description = "Name of the report.") private final String name; /** Date of the report creation. */ + @Schema(name = "date", description = "Date of the report creation.") private final Instant date; /** Column headers of the report. */ + @Schema(name = "header", description = "Column headers of the report.") private final String[] header; /** Descriptions for the rows of the report. */ + @Schema(name = "rowDesc", description = "Descriptions for the rows of the report.") private final String[] rowDesc; /** Description for the sum column. */ + @Schema(name = "sumRowDesc", description = "Description for the sum column.") private final String sumRowDesc; @ConstructorProperties({"name", "date", "header", "rowDesc", "sumRowDesc"}) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentController.java index c2e2049af8..ccf8588ccb 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentController.java @@ -1,10 +1,17 @@ package pro.taskana.task.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.beans.ConstructorProperties; import java.util.List; import java.util.function.BiConsumer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; import org.springframework.http.HttpStatus; @@ -65,10 +72,29 @@ public class TaskCommentController { * @throws TaskCommentNotFoundException if the requested Task Comment is not found * @throws InvalidArgumentException if the requested Id is null or empty */ + @Operation( + summary = "Get a single Task Comment", + description = "This endpoint retrieves a Task Comment.", + parameters = { + @Parameter( + name = "taskCommentId", + description = "The Id of the Task Comment", + example = "TCI:000000000000000000000000000000000000", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the Task Comment", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskCommentRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_TASK_COMMENT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTaskComment( - @PathVariable("taskCommentId") String taskCommentId) + @PathVariable("taskCommentId") String taskCommentId) throws TaskNotFoundException, TaskCommentNotFoundException, InvalidArgumentException, @@ -92,6 +118,28 @@ public ResponseEntity getTaskComment( * @param pagingParameter the paging parameters * @return a list of Task Comments */ + @Operation( + summary = "Get a list of all Task Comments for a specific Task", + description = + "This endpoint retrieves all Task Comments for a specific Task. Further filters can be " + + "applied.", + parameters = { + @Parameter( + name = "taskId", + description = "The Id of the Task whose comments are requested", + example = "TKI:000000000000000000000000000000000000", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "a list of Task Comments", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = TaskCommentCollectionRepresentationModel.class))) + }) @GetMapping(path = RestEndpoints.URL_TASK_COMMENTS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTaskComments( @@ -135,6 +183,17 @@ public ResponseEntity getTaskComments( * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions * @throws NotAuthorizedOnTaskCommentException if the current user has not correct permissions */ + @Operation( + summary = "Delete a Task Comment", + description = "This endpoint deletes a given Task Comment.", + parameters = { + @Parameter( + name = "taskCommentId", + description = "The Id of the Task Comment which should be deleted", + example = "TCI:000000000000000000000000000000000001", + required = true) + }, + responses = {@ApiResponse(responseCode = "204", content = @Content(schema = @Schema()))}) @DeleteMapping(path = RestEndpoints.URL_TASK_COMMENT) @Transactional(rollbackFor = Exception.class) public ResponseEntity deleteTaskComment( @@ -166,6 +225,45 @@ public ResponseEntity deleteTaskComment( * @throws NotAuthorizedOnTaskCommentException if the current user has not correct permissions * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ + @Operation( + summary = "Update a Task Comment", + description = "This endpoint updates a given Task Comment.", + parameters = { + @Parameter( + name = "taskCommentId", + description = "The Id of the Task Comment which should be updated", + example = "TCI:000000000000000000000000000000000000", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "The new comment for the requested id", + content = + @Content( + schema = @Schema(implementation = TaskCommentRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"taskCommentId\": " + + "\"TCI:000000000000000000000000000000000000\",\n" + + " \"taskId\": " + + "\"TKI:000000000000000000000000000000000000\",\n" + + " \"textField\": \"updated text in textfield\",\n" + + " \"creator\": \"user-1-1\",\n" + + " \"creatorFullName\": \"Mustermann, Max\",\n" + + " \"created\": \"2017-01-29T15:55:00Z\",\n" + + " \"modified\": \"2018-01-30T15:55:00Z\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the updated Task Comment", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskCommentRepresentationModel.class))) + }) @PutMapping(path = RestEndpoints.URL_TASK_COMMENT) @Transactional(rollbackFor = Exception.class) public ResponseEntity updateTaskComment( @@ -206,6 +304,39 @@ public ResponseEntity updateTaskComment( * @throws InvalidArgumentException if the Task Comment Id is null or empty * @throws TaskNotFoundException if the requested task does not exist */ + @Operation( + summary = "Create a new Task Comment", + description = "This endpoint creates a Task Comment.", + parameters = { + @Parameter( + name = "taskId", + description = "The Id of the Task where a Task Comment should be created", + example = "TKI:000000000000000000000000000000000000", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "The Task Comment to create", + content = + @Content( + schema = @Schema(implementation = TaskCommentRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"taskId\": " + + "\"TKI:000000000000000000000000000000000000\",\n" + + " \"textField\": \"some text in textfield\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "201", + description = "the created Task Comment", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskCommentRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASK_COMMENTS) @Transactional(rollbackFor = Exception.class) public ResponseEntity createTaskComment( diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentQueryFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentQueryFilterParameter.java index ec52e6fdc8..a287b670de 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentQueryFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskCommentQueryFilterParameter.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.time.Instant; import java.util.Optional; @@ -10,10 +11,15 @@ public class TaskCommentQueryFilterParameter implements QueryParameter { /** Filter by the id of the TaskComment. This is an exact match. */ + @Schema(name = "id", description = "Filter by the id of the TaskComment. This is an exact match.") @JsonProperty("id") private final String[] idIn; /** Filter by what the id of the TaskComment shouldn't be. This is an exact match. */ + @Schema( + name = "id-not", + description = + "Filter by what the id of the TaskComment shouldn't be. This is an exact match.") @JsonProperty("id-not") private final String[] idNotIn; @@ -22,6 +28,12 @@ public class TaskCommentQueryFilterParameter implements QueryParameterThe format is ISO-8601. */ + @Schema( + name = "modified", + description = + "Filter by a time interval within which the TaskComment was modified. To create an open " + + "interval you can just leave it blank. The format is ISO-8601.") @JsonProperty("modified") private final Instant[] modifiedWithin; @@ -92,6 +149,11 @@ public class TaskCommentQueryFilterParameter implements QueryParameterThe format is ISO-8601. */ + @Schema( + name = "modified-not", + description = + "Filter by a time interval within which the TaskComment wasn't modified. To create an " + + "open interval you can just leave it blank. The format is ISO-8601.") @JsonProperty("modified-not") private final Instant[] modifiedNotWithin; @@ -101,6 +163,11 @@ public class TaskCommentQueryFilterParameter implements QueryParameterThe format is ISO-8601. */ + @Schema( + name = "created", + description = + "Filter by a time interval within which the TaskComment was created. To create an open " + + "interval you can just leave it blank. The format is ISO-8601.") @JsonProperty("created") private final Instant[] createdWithin; @@ -110,6 +177,11 @@ public class TaskCommentQueryFilterParameter implements QueryParameterThe format is ISO-8601. */ + @Schema( + name = "created-not", + description = + "Filter by a time interval within which the TaskComment wasn't created. To create an " + + "open interval you can just leave it blank. The format is ISO-8601.") @JsonProperty("created-not") private final Instant[] createdNotWithin; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskController.java index 69aa22f24c..52d0f83943 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskController.java @@ -2,6 +2,12 @@ import static java.util.function.Predicate.not; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.beans.ConstructorProperties; import java.util.HashSet; @@ -10,7 +16,9 @@ import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; import org.springframework.http.HttpStatus; @@ -95,6 +103,61 @@ public class TaskController { * multiple times without using the task-methods * @title Create a new Task */ + @Operation( + summary = "Create a new Task", + description = "This endpoint creates a persistent Task.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the Task which should be created.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class), + examples = + @ExampleObject( + value = + "{" + + "\"priority\" : 0," + + "\"manualPriority\" : -1," + + "\"classificationSummary\" : {" + + "\"key\" : \"L11010\"," + + "\"priority\" : 0" + + "}," + + "\"workbasketSummary\" : {" + + "\"workbasketId\" : " + + "\"WBI:100000000000000000000000000000000004\"," + + "\"markedForDeletion\" : false" + + "}," + + "\"primaryObjRef\" : {" + + "\"company\" : \"MyCompany1\"," + + "\"system\" : \"MySystem1\"," + + "\"systemInstance\" : \"MyInstance1\"," + + "\"type\" : \"MyType1\"," + + "\"value\" : \"00000001\"" + + "}," + + "\"secondaryObjectReferences\" : [ {" + + "\"company\" : \"company\"," + + "\"system\" : \"system\"," + + "\"systemInstance\" : \"systemInstance\"," + + "\"type\" : \"type\"," + + "\"value\" : \"value\"" + + "} ]," + + "\"customAttributes\" : [ ]," + + "\"callbackInfo\" : [ ]," + + "\"attachments\" : [ ]," + + "\"read\" : false," + + "\"transferred\" : false" + + "}"))), + responses = { + @ApiResponse( + responseCode = "201", + description = "the created Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }) + }) @PostMapping(path = RestEndpoints.URL_TASKS) @Transactional(rollbackFor = Exception.class) public ResponseEntity createTask( @@ -140,16 +203,34 @@ public ResponseEntity createTask( * @param pagingParameter the paging parameters * @return the Tasks with the given filter, sort and paging options. */ + @Operation( + summary = "Get a list of all Tasks", + description = "This endpoint retrieves a list of existing Tasks. Filters can be applied.", + parameters = { + @Parameter(name = "por-type", example = "VNR"), + @Parameter(name = "por-value", example = "22334455"), + @Parameter(name = "sort-by", example = "NAME") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the Tasks with the given filter, sort and paging options.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskSummaryPagedRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_TASKS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTasks( HttpServletRequest request, - TaskQueryFilterParameter filterParameter, - TaskQueryFilterCustomFields filterCustomFields, - TaskQueryFilterCustomIntFields filterCustomIntFields, - TaskQueryGroupByParameter groupByParameter, - TaskQuerySortParameter sortParameter, - QueryPagingParameter pagingParameter) { + @ParameterObject TaskQueryFilterParameter filterParameter, + @ParameterObject TaskQueryFilterCustomFields filterCustomFields, + @ParameterObject TaskQueryFilterCustomIntFields filterCustomIntFields, + @ParameterObject TaskQueryGroupByParameter groupByParameter, + @ParameterObject TaskQuerySortParameter sortParameter, + @ParameterObject QueryPagingParameter pagingParameter) { QueryParamsValidator.validateParams( request, TaskQueryFilterParameter.class, @@ -184,6 +265,26 @@ public ResponseEntity getTasks( * requested Task. * @title Get a single Task */ + @Operation( + summary = "Get a single Task", + description = "This endpoint retrieves a specific Task.", + parameters = { + @Parameter( + name = "taskId", + required = true, + description = "the Id of the requested Task", + example = "TKI:100000000000000000000000000000000000") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the requested Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_TASKS_ID) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTask(@PathVariable("taskId") String taskId) @@ -210,6 +311,26 @@ public ResponseEntity getTask(@PathVariable("taskId") S * requested Task. * @title Claim a Task */ + @Operation( + summary = "Claim a Task", + description = "This endpoint claims a Task if possible.", + parameters = { + @Parameter( + name = "taskId", + required = true, + description = "the Id of the Task which should be claimed", + example = "TKI:000000000000000000000000000000000003") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the claimed Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM) @Transactional(rollbackFor = Exception.class) public ResponseEntity claimTask( @@ -236,6 +357,28 @@ public ResponseEntity claimTask( * requested Task. * @title Force claim a Task */ + @Operation( + summary = "Force claim a Task", + description = + "This endpoint force claims a Task if possible even if it is already claimed by someone " + + "else.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task which should be force claimed", + required = true, + example = "TKI:000000000000000000000000000000000003") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the force claimed Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceClaimTask( @@ -262,13 +405,32 @@ public ResponseEntity forceClaimTask( * Workbasket the Task is in * @title Select and claim a Task */ + @Operation( + summary = "Select and claim a Task", + description = + "This endpoint selects the first Task returned by the Task Query and claims it.", + parameters = {@Parameter(name = "custom14", example = "abc")}, + responses = { + @ApiResponse( + responseCode = "200", + description = "the claimed Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }), + @ApiResponse( + responseCode = "404", + description = "if no Task is found", + content = {@Content(schema = @Schema())}) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_SELECT_AND_CLAIM) @Transactional(rollbackFor = Exception.class) public ResponseEntity selectAndClaimTask( - TaskQueryFilterParameter filterParameter, - TaskQueryFilterCustomFields filterCustomFields, - TaskQueryFilterCustomIntFields filterCustomIntFields, - TaskQuerySortParameter sortParameter) + @ParameterObject TaskQueryFilterParameter filterParameter, + @ParameterObject TaskQueryFilterCustomFields filterCustomFields, + @ParameterObject TaskQueryFilterCustomIntFields filterCustomIntFields, + @ParameterObject TaskQuerySortParameter sortParameter) throws InvalidOwnerException, NotAuthorizedOnWorkbasketException { TaskQuery query = taskService.createTaskQuery(); @@ -298,6 +460,31 @@ public ResponseEntity selectAndClaimTask( * Workbasket the Task is in * @title Cancel a claimed Task */ + @Operation( + summary = "Cancel a claimed Task", + description = + "This endpoint cancels the claim of an existing Task if it was claimed by the current " + + "user before.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the requested Task.", + required = true, + example = "TKI:000000000000000000000000000000000002"), + @Parameter( + name = "keepOwner", + description = "flag whether or not to keep the owner despite the cancel claim") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the unclaimed Task", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class)) + }) + }) @DeleteMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM) @Transactional(rollbackFor = Exception.class) public ResponseEntity cancelClaimTask( @@ -325,6 +512,28 @@ public ResponseEntity cancelClaimTask( * Workbasket the Task is in * @title Force cancel a claimed Task */ + @Operation( + summary = "Force cancel a claimed Task", + description = "This endpoint force cancels the claim of an existing Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the requested Task.", + required = true, + example = "TKI:000000000000000000000000000000000002"), + @Parameter( + name = "keepOwner", + description = "flag whether or not to keep the owner despite the cancel claim.") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the unclaimed Task.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @DeleteMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceCancelClaimTask( @@ -350,6 +559,25 @@ public ResponseEntity forceCancelClaimTask( * Workbasket the Task is in * @title Request a review on a Task */ + @Operation( + summary = "Request a review on a Task", + description = "This endpoint requests a review on the specified Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the id of the relevant Task", + required = true, + example = "TKI:000000000000000000000000000000000032") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the Task after a review has been requested", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))), + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_REVIEW) @Transactional(rollbackFor = Exception.class) public ResponseEntity requestReview( @@ -374,6 +602,25 @@ public ResponseEntity requestReview( * Workbasket the Task is in * @title Force request a review on a Task */ + @Operation( + summary = "Force request a review on a Task", + description = "This endpoint force requests a review on the specified Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the id of the relevant Task", + required = true, + example = "TKI:000000000000000000000000000000000101") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the Task after a review has been requested", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_REVIEW_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceRequestReview( @@ -398,6 +645,25 @@ public ResponseEntity forceRequestReview( * Workbasket the Task is in * @title Request changes on a Task */ + @Operation( + summary = "Request changes on a Task", + description = "This endpoint requests changes on the specified Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the id of the relevant Task", + required = true, + example = "TKI:000000000000000000000000000000000136") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "Changes requested successfully", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))), + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_CHANGES) @Transactional(rollbackFor = Exception.class) public ResponseEntity requestChanges( @@ -422,6 +688,25 @@ public ResponseEntity requestChanges( * Workbasket the Task is in * @title Force request changes on a Task */ + @Operation( + summary = "Force request changes on a Task", + description = "This endpoint force requests changes on the specified Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task on which a review should be requested", + required = true, + example = "TKI:000000000000000000000000000000000100") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the change requested Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))), + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_CHANGES_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceRequestChanges( @@ -446,10 +731,28 @@ public ResponseEntity forceRequestChanges( * Workbasket the Task is in * @title Complete a Task */ + @Operation( + summary = "Complete a Task", + description = "This endpoint completes a Task.", + parameters = { + @Parameter( + name = "taskId", + description = "Id of the requested Task to complete.", + example = "TKI:000000000000000000000000000000000003", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the completed Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_COMPLETE) @Transactional(rollbackFor = Exception.class) - public ResponseEntity completeTask( - @PathVariable("taskId") String taskId) + public ResponseEntity completeTask(@PathVariable("taskId") String taskId) throws TaskNotFoundException, InvalidOwnerException, InvalidTaskStateException, @@ -473,6 +776,25 @@ public ResponseEntity completeTask( * Workbasket the Task is in * @title Force complete a Task */ + @Operation( + summary = "Force complete a Task", + description = "This endpoint force completes a Task.", + parameters = { + @Parameter( + name = "taskId", + description = "Id of the requested Task to force complete.", + example = "TKI:000000000000000000000000000000000003", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the force completed Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_COMPLETE_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceCompleteTask( @@ -499,6 +821,27 @@ public ResponseEntity forceCompleteTask( * Workbasket the Task is in * @title Cancel a Task */ + @Operation( + summary = "Cancel a Task", + description = + "This endpoint cancels a Task. Cancellation marks a Task as obsolete. The actual work " + + "the Task was referring to is no longer required", + parameters = { + @Parameter( + name = "taskId", + description = "Id of the requested Task to cancel.", + example = "TKI:000000000000000000000000000000000026", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the cancelled Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_CANCEL) @Transactional(rollbackFor = Exception.class) public ResponseEntity cancelTask(@PathVariable("taskId") String taskId) @@ -520,6 +863,27 @@ public ResponseEntity cancelTask(@PathVariable("taskId" * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions * @title Terminate a Task */ + @Operation( + summary = "Terminate a Task", + description = + "This endpoint terminates a Task. Termination is an administrative action to complete a " + + "Task.", + parameters = { + @Parameter( + name = "taskId", + description = "Id of the requested Task to terminate.", + required = true, + example = "TKI:000000000000000000000000000000000000") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the terminated Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_TERMINATE) @Transactional(rollbackFor = Exception.class) public ResponseEntity terminateTask( @@ -548,6 +912,37 @@ public ResponseEntity terminateTask( * the Task. * @throws InvalidTaskStateException if the Task is in a state which does not allow transferring. */ + @Operation( + summary = "Transfer a Task to another Workbasket", + description = "This endpoint transfers a Task to a given Workbasket, if possible.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task which should be transferred", + example = "TKI:000000000000000000000000000000000004", + required = true), + @Parameter( + name = "workbasketId", + description = "the Id of the destination Workbasket", + example = "WBI:100000000000000000000000000000000001", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "sets the tansfer flag of the task (default: true)", + content = + @Content( + schema = @Schema(implementation = TaskRepresentationModel.class), + examples = @ExampleObject(value = "{\"setTransferFlag\": false}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the successfully transferred Task.", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_TRANSFER_WORKBASKET_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity transferTask( @@ -584,6 +979,122 @@ public ResponseEntity transferTask( * Task is not in state READY. * @title Update a Task */ + @Operation( + summary = "Update a Task", + description = "This endpoint updates a requested Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task which should be updated", + example = "TKI:000000000000000000000000000000000003", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the new Task for the requested id.", + content = + @Content( + schema = @Schema(implementation = TaskRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"taskId\": " + + "\"TKI:000000000000000000000000000000000003\",\n" + + " \"externalId\": " + + "\"ETI:000000000000000000000000000000000003\",\n" + + " \"created\": \"2018-02-01T12:00:00.000Z\",\n" + + " \"modified\": \"2018-02-01T12:00:00.000Z\",\n" + + " \"planned\": \"2024-05-27T15:27:56.595Z\",\n" + + " \"received\": \"2024-05-29T15:27:56.595Z\",\n" + + " \"due\": \"2024-05-29T15:27:56.595Z\",\n" + + " \"name\": \"Widerruf\",\n" + + " \"creator\": \"creator_user_id\",\n" + + " \"description\": \"new description\",\n" + + " \"priority\": 2,\n" + + " \"manualPriority\": -1,\n" + + " \"state\": \"READY\",\n" + + " \"classificationSummary\": {\n" + + " \"classificationId\": " + + "\"CLI:100000000000000000000000000000000003\",\n" + + " \"key\": \"L1050\",\n" + + " \"applicationEntryPoint\": \"\",\n" + + " \"category\": \"EXTERNAL\",\n" + + " \"domain\": \"DOMAIN_A\",\n" + + " \"name\": \"Widerruf\",\n" + + " \"parentId\": \"\",\n" + + " \"parentKey\": \"\",\n" + + " \"priority\": 1,\n" + + " \"serviceLevel\": \"P13D\",\n" + + " \"type\": \"TASK\",\n" + + " \"custom1\": \"VNR,RVNR,KOLVNR\",\n" + + " \"custom2\": \"\",\n" + + " \"custom3\": \"\",\n" + + " \"custom4\": \"\",\n" + + " \"custom5\": \"\",\n" + + " \"custom6\": \"\",\n" + + " \"custom7\": \"\",\n" + + " \"custom8\": \"\"\n" + + " },\n" + + " \"workbasketSummary\": {\n" + + " \"workbasketId\": " + + "\"WBI:100000000000000000000000000000000001\",\n" + + " \"key\": \"GPK_KSC\",\n" + + " \"name\": \"Gruppenpostkorb KSC\",\n" + + " \"domain\": \"DOMAIN_A\",\n" + + " \"type\": \"GROUP\",\n" + + " \"description\": \"Gruppenpostkorb KSC\",\n" + + " \"owner\": \"teamlead-1\",\n" + + " \"custom1\": \"ABCQVW\",\n" + + " \"custom2\": \"\",\n" + + " \"custom3\": \"xyz4\",\n" + + " \"custom4\": \"\",\n" + + " \"custom5\": \"\",\n" + + " \"custom6\": \"\",\n" + + " \"custom7\": \"\",\n" + + " \"custom8\": \"\",\n" + + " \"orgLevel1\": \"\",\n" + + " \"orgLevel2\": \"\",\n" + + " \"orgLevel3\": \"\",\n" + + " \"orgLevel4\": \"\",\n" + + " \"markedForDeletion\": false\n" + + " },\n" + + " \"businessProcessId\": \"PI_0000000000003\",\n" + + " \"parentBusinessProcessId\": " + + "\"DOC_0000000000000000003\",\n" + + " \"primaryObjRef\": {\n" + + " \"company\": \"00\",\n" + + " \"system\": \"PASystem\",\n" + + " \"systemInstance\": \"00\",\n" + + " \"type\": \"VNR\",\n" + + " \"value\": \"11223344\"\n" + + " },\n" + + " \"custom1\": \"efg\",\n" + + " \"custom14\": \"abc\",\n" + + " \"customInt1\": 1,\n" + + " \"customInt2\": 2,\n" + + " \"customInt3\": 3,\n" + + " \"customInt4\": 4,\n" + + " \"customInt5\": 5,\n" + + " \"customInt6\": 6,\n" + + " \"customInt7\": 7,\n" + + " \"customInt8\": 8,\n" + + " \"secondaryObjectReferences\": [],\n" + + " \"customAttributes\": [],\n" + + " \"callbackInfo\": [],\n" + + " \"attachments\": [],\n" + + " \"read\": false,\n" + + " \"transferred\": false\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the updated Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PutMapping(path = RestEndpoints.URL_TASKS_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity updateTask( @@ -630,6 +1141,33 @@ public ResponseEntity updateTask( * Workbasket the Task is in * @title Set a Task read or unread */ + @Operation( + summary = "Set a Task read or unread", + description = "This endpoint sets the 'isRead' property of a Task.", + parameters = { + @Parameter( + name = "taskId", + description = "Id of the requested Task to set read or unread.", + example = "TKI:000000000000000000000000000000000025", + required = true) + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = + "if true, the Task property isRead is set to true, else it's set to false", + content = + @Content( + schema = @Schema(implementation = TaskRepresentationModel.class), + examples = @ExampleObject(value = "{\"is-read\": true}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the updated Task", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = TaskRepresentationModel.class))) + }) @PostMapping(path = RestEndpoints.URL_TASKS_ID_SET_READ) @Transactional(rollbackFor = Exception.class) public ResponseEntity setTaskRead( @@ -657,6 +1195,17 @@ public ResponseEntity setTaskRead( * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions * @throws InvalidCallbackStateException some comment */ + @Operation( + summary = "Delete a Task", + description = "This endpoint deletes a Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task which should be deleted.", + required = true, + example = "TKI:000000000000000000000000000000000039") + }, + responses = {@ApiResponse(responseCode = "204", content = @Content(schema = @Schema()))}) @DeleteMapping(path = RestEndpoints.URL_TASKS_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity deleteTask(@PathVariable("taskId") String taskId) @@ -683,6 +1232,17 @@ public ResponseEntity deleteTask(@PathVariable("taskId" * @throws NotAuthorizedOnWorkbasketException if the current user has not correct * @throws InvalidCallbackStateException some comment */ + @Operation( + summary = "Force delete a Task", + description = "This endpoint force deletes a Task.", + parameters = { + @Parameter( + name = "taskId", + description = "the Id of the Task which should be force deleted.", + example = "TKI:000000000000000000000000000000000005", + required = true) + }, + responses = {@ApiResponse(responseCode = "204", content = @Content(schema = @Schema()))}) @DeleteMapping(path = RestEndpoints.URL_TASKS_ID_FORCE) @Transactional(rollbackFor = Exception.class) public ResponseEntity forceDeleteTask( @@ -710,12 +1270,36 @@ public ResponseEntity forceDeleteTask( * @throws NotAuthorizedException if the current user is not authorized to delete the requested * Tasks. */ + @Operation( + summary = "Delete multiple Tasks", + description = + "This endpoint deletes an aggregation of Tasks and returns the deleted Tasks. Filters " + + "can be applied.", + parameters = { + @Parameter( + name = "task-id", + examples = { + @ExampleObject(value = "TKI:000000000000000000000000000000000036"), + @ExampleObject(value = "TKI:000000000000000000000000000000000037"), + @ExampleObject(value = "TKI:000000000000000000000000000000000038") + }) + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the deleted task summaries", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = TaskSummaryCollectionRepresentationModel.class))) + }) @DeleteMapping(path = RestEndpoints.URL_TASKS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity deleteTasks( - TaskQueryFilterParameter filterParameter, - TaskQueryFilterCustomFields filterCustomFields, - TaskQueryFilterCustomIntFields filterCustomIntFields) + @ParameterObject TaskQueryFilterParameter filterParameter, + @ParameterObject TaskQueryFilterCustomFields filterCustomFields, + @ParameterObject TaskQueryFilterCustomIntFields filterCustomIntFields) throws InvalidArgumentException, NotAuthorizedException { TaskQuery query = taskService.createTaskQuery(); filterParameter.apply(query); diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterCustomFields.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterCustomFields.java index 143d989328..a96a7e10be 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterCustomFields.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterCustomFields.java @@ -20,6 +20,7 @@ import static pro.taskana.task.api.TaskCustomField.CUSTOM_9; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Optional; import java.util.stream.Stream; @@ -28,11 +29,271 @@ import pro.taskana.task.api.TaskQuery; public class TaskQueryFilterCustomFields implements QueryParameter { + public String[] getCustom1In() { + return custom1In; + } + + public String[] getCustom1NotIn() { + return custom1NotIn; + } + + public String[] getCustom1Like() { + return custom1Like; + } + + public String[] getCustom1NotLike() { + return custom1NotLike; + } + + public String[] getCustom2In() { + return custom2In; + } + + public String[] getCustom2NotIn() { + return custom2NotIn; + } + + public String[] getCustom2Like() { + return custom2Like; + } + + public String[] getCustom2NotLike() { + return custom2NotLike; + } + + public String[] getCustom3In() { + return custom3In; + } + + public String[] getCustom3NotIn() { + return custom3NotIn; + } + + public String[] getCustom3Like() { + return custom3Like; + } + + public String[] getCustom3NotLike() { + return custom3NotLike; + } + + public String[] getCustom4In() { + return custom4In; + } + + public String[] getCustom4NotIn() { + return custom4NotIn; + } + + public String[] getCustom4Like() { + return custom4Like; + } + + public String[] getCustom4NotLike() { + return custom4NotLike; + } + + public String[] getCustom5In() { + return custom5In; + } + + public String[] getCustom5NotIn() { + return custom5NotIn; + } + + public String[] getCustom5Like() { + return custom5Like; + } + + public String[] getCustom5NotLike() { + return custom5NotLike; + } + + public String[] getCustom6In() { + return custom6In; + } + + public String[] getCustom6NotIn() { + return custom6NotIn; + } + + public String[] getCustom6Like() { + return custom6Like; + } + + public String[] getCustom6NotLike() { + return custom6NotLike; + } + + public String[] getCustom7In() { + return custom7In; + } + + public String[] getCustom7NotIn() { + return custom7NotIn; + } + + public String[] getCustom7Like() { + return custom7Like; + } + + public String[] getCustom7NotLike() { + return custom7NotLike; + } + + public String[] getCustom8In() { + return custom8In; + } + + public String[] getCustom8NotIn() { + return custom8NotIn; + } + + public String[] getCustom8Like() { + return custom8Like; + } + + public String[] getCustom8NotLike() { + return custom8NotLike; + } + + public String[] getCustom9In() { + return custom9In; + } + + public String[] getCustom9NotIn() { + return custom9NotIn; + } + + public String[] getCustom9Like() { + return custom9Like; + } + + public String[] getCustom9NotLike() { + return custom9NotLike; + } + + public String[] getCustom10In() { + return custom10In; + } + + public String[] getCustom10NotIn() { + return custom10NotIn; + } + + public String[] getCustom10Like() { + return custom10Like; + } + + public String[] getCustom10NotLike() { + return custom10NotLike; + } + + public String[] getCustom11In() { + return custom11In; + } + + public String[] getCustom11NotIn() { + return custom11NotIn; + } + + public String[] getCustom11Like() { + return custom11Like; + } + + public String[] getCustom11NotLike() { + return custom11NotLike; + } + + public String[] getCustom12In() { + return custom12In; + } + + public String[] getCustom12NotIn() { + return custom12NotIn; + } + + public String[] getCustom12Like() { + return custom12Like; + } + + public String[] getCustom12NotLike() { + return custom12NotLike; + } + + public String[] getCustom13In() { + return custom13In; + } + + public String[] getCustom13NotIn() { + return custom13NotIn; + } + + public String[] getCustom13Like() { + return custom13Like; + } + + public String[] getCustom13NotLike() { + return custom13NotLike; + } + + public String[] getCustom14In() { + return custom14In; + } + + public String[] getCustom14NotIn() { + return custom14NotIn; + } + + public String[] getCustom14Like() { + return custom14Like; + } + + public String[] getCustom14NotLike() { + return custom14NotLike; + } + + public String[] getCustom15In() { + return custom15In; + } + + public String[] getCustom15NotIn() { + return custom15NotIn; + } + + public String[] getCustom15Like() { + return custom15Like; + } + + public String[] getCustom15NotLike() { + return custom15NotLike; + } + + public String[] getCustom16In() { + return custom16In; + } + + public String[] getCustom16NotIn() { + return custom16NotIn; + } + + public String[] getCustom16Like() { + return custom16Like; + } + + public String[] getCustom16NotLike() { + return custom16NotLike; + } + /** Filter by the value of the field custom1 of the Task. This is an exact match. */ + @Schema( + name = "custom-1", + description = "Filter by the value of the field custom1 of the Task. This is an exact match.") @JsonProperty("custom-1") private final String[] custom1In; /** Exclude values of the field custom1 of the Task. */ + @Schema(name = "custom-1-not", description = "Exclude values of the field custom1 of the Task.") @JsonProperty("custom-1-not") private final String[] custom1NotIn; @@ -41,6 +302,12 @@ public class TaskQueryFilterCustomFields implements QueryParameter { + public Integer[] getCustomInt1In() { + return customInt1In; + } + + public Integer[] getCustomInt1NotIn() { + return customInt1NotIn; + } + + public Integer[] getCustomInt1Within() { + return customInt1Within; + } + + public Integer[] getCustomInt1NotWithin() { + return customInt1NotWithin; + } + + public Integer getCustomInt1From() { + return customInt1From; + } + + public Integer getCustomInt1FromNot() { + return customInt1FromNot; + } + + public Integer getCustomInt1To() { + return customInt1To; + } + + public Integer getCustomInt1ToNot() { + return customInt1ToNot; + } + + public Integer[] getCustomInt2In() { + return customInt2In; + } + + public Integer[] getCustomInt2NotIn() { + return customInt2NotIn; + } + + public Integer[] getCustomInt2Within() { + return customInt2Within; + } + + public Integer[] getCustomInt2NotWithin() { + return customInt2NotWithin; + } + + public Integer getCustomInt2From() { + return customInt2From; + } + + public Integer getCustomInt2FromNot() { + return customInt2FromNot; + } + + public Integer getCustomInt2To() { + return customInt2To; + } + + public Integer getCustomInt2ToNot() { + return customInt2ToNot; + } + + public Integer[] getCustomInt3In() { + return customInt3In; + } + + public Integer[] getCustomInt3NotIn() { + return customInt3NotIn; + } + + public Integer[] getCustomInt3Within() { + return customInt3Within; + } + + public Integer[] getCustomInt3NotWithin() { + return customInt3NotWithin; + } + + public Integer getCustomInt3From() { + return customInt3From; + } + + public Integer getCustomInt3FromNot() { + return customInt3FromNot; + } + + public Integer getCustomInt3To() { + return customInt3To; + } + + public Integer getCustomInt3ToNot() { + return customInt3ToNot; + } + + public Integer[] getCustomInt4In() { + return customInt4In; + } + + public Integer[] getCustomInt4NotIn() { + return customInt4NotIn; + } + + public Integer[] getCustomInt4Within() { + return customInt4Within; + } + + public Integer[] getCustomInt4NotWithin() { + return customInt4NotWithin; + } + + public Integer getCustomInt4From() { + return customInt4From; + } + + public Integer getCustomInt4FromNot() { + return customInt4FromNot; + } + + public Integer getCustomInt4To() { + return customInt4To; + } + + public Integer getCustomInt4ToNot() { + return customInt4ToNot; + } + + public Integer[] getCustomInt5In() { + return customInt5In; + } + + public Integer[] getCustomInt5NotIn() { + return customInt5NotIn; + } + + public Integer[] getCustomInt5Within() { + return customInt5Within; + } + + public Integer[] getCustomInt5NotWithin() { + return customInt5NotWithin; + } + + public Integer getCustomInt5From() { + return customInt5From; + } + + public Integer getCustomInt5FromNot() { + return customInt5FromNot; + } + + public Integer getCustomInt5To() { + return customInt5To; + } + + public Integer getCustomInt5ToNot() { + return customInt5ToNot; + } + + public Integer[] getCustomInt6In() { + return customInt6In; + } + + public Integer[] getCustomInt6NotIn() { + return customInt6NotIn; + } + + public Integer[] getCustomInt6Within() { + return customInt6Within; + } + + public Integer[] getCustomInt6NotWithin() { + return customInt6NotWithin; + } + + public Integer getCustomInt6From() { + return customInt6From; + } + + public Integer getCustomInt6FromNot() { + return customInt6FromNot; + } + + public Integer getCustomInt6To() { + return customInt6To; + } + + public Integer getCustomInt6ToNot() { + return customInt6ToNot; + } + + public Integer[] getCustomInt7In() { + return customInt7In; + } + + public Integer[] getCustomInt7NotIn() { + return customInt7NotIn; + } + + public Integer[] getCustomInt7Within() { + return customInt7Within; + } + + public Integer[] getCustomInt7NotWithin() { + return customInt7NotWithin; + } + + public Integer getCustomInt7From() { + return customInt7From; + } + + public Integer getCustomInt7FromNot() { + return customInt7FromNot; + } + + public Integer getCustomInt7To() { + return customInt7To; + } + + public Integer getCustomInt7ToNot() { + return customInt7ToNot; + } + + public Integer[] getCustomInt8In() { + return customInt8In; + } + + public Integer[] getCustomInt8NotIn() { + return customInt8NotIn; + } + + public Integer[] getCustomInt8Within() { + return customInt8Within; + } + + public Integer[] getCustomInt8NotWithin() { + return customInt8NotWithin; + } + + public Integer getCustomInt8From() { + return customInt8From; + } + + public Integer getCustomInt8FromNot() { + return customInt8FromNot; + } + + public Integer getCustomInt8To() { + return customInt8To; + } + + public Integer getCustomInt8ToNot() { + return customInt8ToNot; + } /** Filter by the value of the field customInt1 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-1", + description = + "Filter by the value of the field customInt1 of the Task. This is an exact match.") @JsonProperty("custom-int-1") private final Integer[] customInt1In; /** Exclude values of the field customInt1 of the Task. */ + @Schema( + name = "custom-int-1-not", + description = "Exclude values of the field customInt1 of the Task.") @JsonProperty("custom-int-1-not") private final Integer[] customInt1NotIn; /** Filter by the range of value of the field customInt1 of the Task. */ + @Schema( + name = "custom-int-1-within", + description = "Filter by the range of value of the field customInt1 of the Task.") @JsonProperty("custom-int-1-within") private final Integer[] customInt1Within; /** Exclude range of values of the field customInt1 of the Task. */ + @Schema( + name = "custom-int-1-not-within", + description = "Exclude range of values of the field customInt1 of the Task.") @JsonProperty("custom-int-1-not-within") private final Integer[] customInt1NotWithin; @@ -36,9 +305,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-1-within'. */ + @Schema( + name = "custom-int-1-from", + description = + "Filter by lower bound of customInt1.

This parameter can't be used together with " + + "'custom-int-1-within'.") @JsonProperty("custom-int-1-from") private final Integer customInt1From; /** Exclude values from a lower bound of the field customInt1 of the Task. */ + @Schema( + name = "custom-int-1-from-not", + description = "Exclude values from a lower bound of the field customInt1 of the Task.") @JsonProperty("custom-int-1-from-not") private final Integer customInt1FromNot; /** @@ -46,24 +323,45 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-1-within'. */ + @Schema( + name = "custom-int-1-to", + description = + "Filter by upper bound of customInt1.

This parameter can't be used together with " + + "'custom-int-1-within'.") @JsonProperty("custom-int-1-to") private final Integer customInt1To; /** Exclude values to an upper bound of the field customInt1 of the Task. */ + @Schema( + name = "custom-int-1-to-not", + description = "Exclude values to an upper bound of the field customInt1 of the Task.") @JsonProperty("custom-int-1-to-not") private final Integer customInt1ToNot; /** Filter by the value of the field customInt2 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-2", + description = + "Filter by the value of the field customInt2 of the Task. This is an exact match.") @JsonProperty("custom-int-2") private final Integer[] customInt2In; /** Exclude values of the field customInt2 of the Task. */ + @Schema( + name = "custom-int-2-not", + description = "Exclude values of the field customInt2 of the Task.") @JsonProperty("custom-int-2-not") private final Integer[] customInt2NotIn; /** Filter by the range of value of the field customInt2 of the Task. */ + @Schema( + name = "custom-int-2-within", + description = "Filter by the range of value of the field customInt2 of the Task.") @JsonProperty("custom-int-2-within") private final Integer[] customInt2Within; /** Exclude range of values of the field customInt2 of the Task. */ + @Schema( + name = "custom-int-2-not-within", + description = "Exclude range of values of the field customInt2 of the Task.") @JsonProperty("custom-int-2-not-within") private final Integer[] customInt2NotWithin; /** @@ -71,9 +369,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-2-within'. */ + @Schema( + name = "custom-int-2-from", + description = + "Filter by lower bound of customInt2.

This parameter can't be used together with " + + "'custom-int-2-within'.") @JsonProperty("custom-int-2-from") private final Integer customInt2From; /** Exclude values from a lower bound of the field customInt2 of the Task. */ + @Schema( + name = "custom-int-2-from-not", + description = "Exclude values from a lower bound of the field customInt2 of the Task.") @JsonProperty("custom-int-2-from-not") private final Integer customInt2FromNot; /** @@ -81,22 +387,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-2-within'. */ + @Schema( + name = "custom-int-2-to", + description = + "Filter by upper bound of customInt2.

This parameter can't be used together with " + + "'custom-int-2-within'.") @JsonProperty("custom-int-2-to") private final Integer customInt2To; /** Exclude values to an upper bound of the field customInt2 of the Task. */ + @Schema( + name = "custom-int-2-to-not", + description = "Exclude values to an upper bound of the field customInt2 of the Task.") @JsonProperty("custom-int-2-to-not") private final Integer customInt2ToNot; /** Filter by the value of the field customInt3 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-3", + description = + "Filter by the value of the field customInt3 of the Task. This is an exact match.") @JsonProperty("custom-int-3") private final Integer[] customInt3In; /** Exclude values of the field customInt3 of the Task. */ + @Schema( + name = "custom-int-3-not", + description = "Exclude values of the field customInt3 of the Task.") @JsonProperty("custom-int-3-not") private final Integer[] customInt3NotIn; /** Filter by the range of value of the field customInt3 of the Task. */ + @Schema( + name = "custom-int-3-within", + description = "Filter by the range of value of the field customInt3 of the Task.") @JsonProperty("custom-int-3-within") private final Integer[] customInt3Within; /** Exclude range of values of the field customInt3 of the Task. */ + @Schema( + name = "custom-int-3-not-within", + description = "Exclude range of values of the field customInt3 of the Task.") @JsonProperty("custom-int-3-not-within") private final Integer[] customInt3NotWithin; /** @@ -104,9 +431,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-3-within'. */ + @Schema( + name = "custom-int-3-from", + description = + "Filter by lower bound of customInt3.

This parameter can't be used together with " + + "'custom-int-3-within'.") @JsonProperty("custom-int-3-from") private final Integer customInt3From; /** Exclude values from a lower bound of the field customInt3 of the Task. */ + @Schema( + name = "custom-int-3-from-not", + description = "Exclude values from a lower bound of the field customInt3 of the Task.") @JsonProperty("custom-int-3-from-not") private final Integer customInt3FromNot; /** @@ -114,22 +449,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-3-within'. */ + @Schema( + name = "custom-int-3-to", + description = + "Filter by upper bound of customInt3.

This parameter can't be used together with " + + "'custom-int-3-within'.") @JsonProperty("custom-int-3-to") private final Integer customInt3To; /** Exclude values to an upper bound of the field customInt3 of the Task. */ + @Schema( + name = "custom-int-3-to-not", + description = "Exclude values to an upper bound of the field customInt3 of the Task.") @JsonProperty("custom-int-3-to-not") private final Integer customInt3ToNot; /** Filter by the value of the field customInt4 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-4", + description = + "Filter by the value of the field customInt4 of the Task. This is an exact match.") @JsonProperty("custom-int-4") private final Integer[] customInt4In; /** Exclude values of the field customInt4 of the Task. */ + @Schema( + name = "custom-int-4-not", + description = "Exclude values of the field customInt4 of the Task.") @JsonProperty("custom-int-4-not") private final Integer[] customInt4NotIn; /** Filter by the range of value of the field customInt4 of the Task. */ + @Schema( + name = "custom-int-4-within", + description = "Filter by the range of value of the field customInt4 of the Task.") @JsonProperty("custom-int-4-within") private final Integer[] customInt4Within; /** Exclude range of values of the field customInt4 of the Task. */ + @Schema( + name = "custom-int-4-not-within", + description = "Exclude range of values of the field customInt4 of the Task.") @JsonProperty("custom-int-4-not-within") private final Integer[] customInt4NotWithin; /** @@ -137,9 +493,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-4-within'. */ + @Schema( + name = "custom-int-4-from", + description = + "Filter by lower bound of customInt4.

This parameter can't be used together with " + + "'custom-int-4-within'.") @JsonProperty("custom-int-4-from") private final Integer customInt4From; /** Exclude values from a lower bound of the field customInt4 of the Task. */ + @Schema( + name = "custom-int-4-from-not", + description = "Exclude values from a lower bound of the field customInt4 of the Task.") @JsonProperty("custom-int-4-from-not") private final Integer customInt4FromNot; /** @@ -147,22 +511,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-4-within'. */ + @Schema( + name = "custom-int-4-to", + description = + "Filter by upper bound of customInt4.

This parameter can't be used together with " + + "'custom-int-4-within'.") @JsonProperty("custom-int-4-to") private final Integer customInt4To; /** Exclude values to an upper bound of the field customInt4 of the Task. */ + @Schema( + name = "custom-int-4-to-not", + description = "Exclude values to an upper bound of the field customInt4 of the Task.") @JsonProperty("custom-int-4-to-not") private final Integer customInt4ToNot; /** Filter by the value of the field customInt5 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-5", + description = + "Filter by the value of the field customInt5 of the Task. This is an exact match.") @JsonProperty("custom-int-5") private final Integer[] customInt5In; /** Exclude values of the field customInt5 of the Task. */ + @Schema( + name = "custom-int-5-not", + description = "Exclude values of the field customInt5 of the Task.") @JsonProperty("custom-int-5-not") private final Integer[] customInt5NotIn; /** Filter by the range of value of the field customInt5 of the Task. */ + @Schema( + name = "custom-int-5-within", + description = "Filter by the range of value of the field customInt5 of the Task.") @JsonProperty("custom-int-5-within") private final Integer[] customInt5Within; /** Exclude range of values of the field customInt5 of the Task. */ + @Schema( + name = "custom-int-5-not-within", + description = "Exclude range of values of the field customInt5 of the Task.") @JsonProperty("custom-int-5-not-within") private final Integer[] customInt5NotWithin; /** @@ -170,9 +555,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-5-within'. */ + @Schema( + name = "custom-int-5-from", + description = + "Filter by lower bound of customInt5.

This parameter can't be used together with " + + "'custom-int-5-within'.") @JsonProperty("custom-int-5-from") private final Integer customInt5From; /** Exclude values from a lower bound of the field customInt5 of the Task. */ + @Schema( + name = "custom-int-5-from-not", + description = "Exclude values from a lower bound of the field customInt5 of the Task.") @JsonProperty("custom-int-5-from-not") private final Integer customInt5FromNot; /** @@ -180,22 +573,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-5-within'. */ + @Schema( + name = "custom-int-5-to", + description = + "Filter by upper bound of customInt5.

This parameter can't be used together with " + + "'custom-int-5-within'.") @JsonProperty("custom-int-5-to") private final Integer customInt5To; /** Exclude values to an upper bound of the field customInt5 of the Task. */ + @Schema( + name = "custom-int-5-to-not", + description = "Exclude values to an upper bound of the field customInt5 of the Task.") @JsonProperty("custom-int-5-to-not") private final Integer customInt5ToNot; /** Filter by the value of the field customInt6 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-6", + description = + "Filter by the value of the field customInt6 of the Task. This is an exact match.") @JsonProperty("custom-int-6") private final Integer[] customInt6In; /** Exclude values of the field customInt6 of the Task. */ + @Schema( + name = "custom-int-6-not", + description = "Exclude values of the field customInt6 of the Task.") @JsonProperty("custom-int-6-not") private final Integer[] customInt6NotIn; /** Filter by the range of value of the field customInt6 of the Task. */ + @Schema( + name = "custom-int-6-within", + description = "Filter by the range of value of the field customInt6 of the Task.") @JsonProperty("custom-int-6-within") private final Integer[] customInt6Within; /** Exclude range of values of the field customInt6 of the Task. */ + @Schema( + name = "custom-int-6-not-within", + description = "Exclude range of values of the field customInt6 of the Task.") @JsonProperty("custom-int-6-not-within") private final Integer[] customInt6NotWithin; /** @@ -203,9 +617,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-6-within'. */ + @Schema( + name = "custom-int-6-from", + description = + "Filter by lower bound of customInt6.

This parameter can't be used together with " + + "'custom-int-6-within'.") @JsonProperty("custom-int-6-from") private final Integer customInt6From; /** Exclude values from a lower bound of the field customInt6 of the Task. */ + @Schema( + name = "custom-int-6-from-not", + description = "Exclude values from a lower bound of the field customInt6 of the Task.") @JsonProperty("custom-int-6-from-not") private final Integer customInt6FromNot; /** @@ -213,22 +635,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-6-within'. */ + @Schema( + name = "custom-int-6-to", + description = + "Filter by upper bound of customInt6.

This parameter can't be used together with " + + "'custom-int-6-within'.") @JsonProperty("custom-int-6-to") private final Integer customInt6To; /** Exclude values to an upper bound of the field customInt6 of the Task. */ + @Schema( + name = "custom-int-6-to-not", + description = "Exclude values to an upper bound of the field customInt6 of the Task.") @JsonProperty("custom-int-6-to-not") private final Integer customInt6ToNot; /** Filter by the value of the field customInt7 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-7", + description = + "Filter by the value of the field customInt7 of the Task. This is an exact match.") @JsonProperty("custom-int-7") private final Integer[] customInt7In; /** Exclude values of the field customInt7 of the Task. */ + @Schema( + name = "custom-int-7-not", + description = "Exclude values of the field customInt7 of the Task.") @JsonProperty("custom-int-7-not") private final Integer[] customInt7NotIn; /** Filter by the range of value of the field customInt7 of the Task. */ + @Schema( + name = "custom-int-7-within", + description = "Filter by the range of value of the field customInt7 of the Task.") @JsonProperty("custom-int-7-within") private final Integer[] customInt7Within; /** Exclude range of values of the field customInt7 of the Task. */ + @Schema( + name = "custom-int-7-not-within", + description = "Exclude range of values of the field customInt7 of the Task.") @JsonProperty("custom-int-7-not-within") private final Integer[] customInt7NotWithin; /** @@ -236,9 +679,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-7-within'. */ + @Schema( + name = "custom-int-7-from", + description = + "Filter by lower bound of customInt7.

This parameter can't be used together with " + + "'custom-int-7-within'.") @JsonProperty("custom-int-7-from") private final Integer customInt7From; /** Exclude values from a lower bound of the field customInt7 of the Task. */ + @Schema( + name = "custom-int-7-from-not", + description = "Exclude values from a lower bound of the field customInt7 of the Task.") @JsonProperty("custom-int-7-from-not") private final Integer customInt7FromNot; /** @@ -246,22 +697,43 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-7-within'. */ + @Schema( + name = "custom-int-7-to", + description = + "Filter by upper bound of customInt7.

This parameter can't be used together with " + + "'custom-int-7-within'.") @JsonProperty("custom-int-7-to") private final Integer customInt7To; /** Exclude values to an upper bound of the field customInt7 of the Task. */ + @Schema( + name = "custom-int-7-to-not", + description = "Exclude values to an upper bound of the field customInt7 of the Task.") @JsonProperty("custom-int-7-to-not") private final Integer customInt7ToNot; /** Filter by the value of the field customInt8 of the Task. This is an exact match. */ + @Schema( + name = "custom-int-8", + description = + "Filter by the value of the field customInt8 of the Task. This is an exact match.") @JsonProperty("custom-int-8") private final Integer[] customInt8In; /** Exclude values of the field customInt8 of the Task. */ + @Schema( + name = "custom-int-8-not", + description = "Exclude values of the field customInt8 of the Task.") @JsonProperty("custom-int-8-not") private final Integer[] customInt8NotIn; /** Filter by the range of value of the field customInt8 of the Task. */ + @Schema( + name = "custom-int-8-within", + description = "Filter by the range of value of the field customInt8 of the Task.") @JsonProperty("custom-int-8-within") private final Integer[] customInt8Within; /** Exclude range of values of the field customInt8 of the Task. */ + @Schema( + name = "custom-int-8-not-within", + description = "Exclude range of values of the field customInt8 of the Task.") @JsonProperty("custom-int-8-not-within") private final Integer[] customInt8NotWithin; /** @@ -269,9 +741,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-8-within'. */ + @Schema( + name = "custom-int-8-from", + description = + "Filter by lower bound of customInt8.

This parameter can't be used together with " + + "'custom-int-8-within'.") @JsonProperty("custom-int-8-from") private final Integer customInt8From; /** Exclude values from a lower bound of the field customInt8 of the Task. */ + @Schema( + name = "custom-int-8-from-not", + description = "Exclude values from a lower bound of the field customInt8 of the Task.") @JsonProperty("custom-int-8-from-not") private final Integer customInt8FromNot; /** @@ -279,9 +759,17 @@ public class TaskQueryFilterCustomIntFields implements QueryParameterThis parameter can't be used together with 'custom-int-8-within'. */ + @Schema( + name = "custom-int-8-to", + description = + "Filter by upper bound of customInt8.

This parameter can't be used together with " + + "'custom-int-8-within'.") @JsonProperty("custom-int-8-to") private final Integer customInt8To; /** Exclude values to an upper bound of the field customInt8 of the Task. */ + @Schema( + name = "custom-int-8-to-not", + description = "Exclude values to an upper bound of the field customInt8 of the Task.") @JsonProperty("custom-int-8-to-not") private final Integer customInt8ToNot; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterParameter.java index c1af19acbe..d444add6da 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryFilterParameter.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.time.Instant; import java.util.ArrayList; @@ -20,21 +21,652 @@ public class TaskQueryFilterParameter implements QueryParameter { + public String[] getTaskIdIn() { + return taskIdIn; + } + + public String[] getExternalIdIn() { + return externalIdIn; + } + + public String[] getExternalIdNotIn() { + return externalIdNotIn; + } + + public Instant[] getReceivedWithin() { + return receivedWithin; + } + + public Instant getReceivedFrom() { + return receivedFrom; + } + + public Instant getReceivedUntil() { + return receivedUntil; + } + + public Instant[] getReceivedNotIn() { + return receivedNotIn; + } + + public Instant getReceivedFromNot() { + return receivedFromNot; + } + + public Instant getReceivedUntilNot() { + return receivedUntilNot; + } + + public Instant[] getCreatedWithin() { + return createdWithin; + } + + public Instant getCreatedFrom() { + return createdFrom; + } + + public Instant getCreatedUntil() { + return createdUntil; + } + + public Instant[] getCreatedNotWithin() { + return createdNotWithin; + } + + public Instant getCreatedFromNot() { + return createdFromNot; + } + + public Instant getCreatedUntilNot() { + return createdUntilNot; + } + + public Instant[] getClaimedWithin() { + return claimedWithin; + } + + public Instant[] getClaimedNotWithin() { + return claimedNotWithin; + } + + public Instant[] getModifiedWithin() { + return modifiedWithin; + } + + public Instant[] getModifiedNotWithin() { + return modifiedNotWithin; + } + + public Instant[] getPlannedWithin() { + return plannedWithin; + } + + public Instant getPlannedFrom() { + return plannedFrom; + } + + public Instant getPlannedUntil() { + return plannedUntil; + } + + public Instant[] getPlannedNotWithin() { + return plannedNotWithin; + } + + public Instant getPlannedFromNot() { + return plannedFromNot; + } + + public Instant getPlannedUntilNot() { + return plannedUntilNot; + } + + public Instant[] getDueWithin() { + return dueWithin; + } + + public Instant getDueFrom() { + return dueFrom; + } + + public Instant getDueUntil() { + return dueUntil; + } + + public Instant[] getDueNotWithin() { + return dueNotWithin; + } + + public Instant getDueFromNot() { + return dueFromNot; + } + + public Instant getDueUntilNot() { + return dueUntilNot; + } + + public Instant[] getCompletedWithin() { + return completedWithin; + } + + public Instant getCompletedFrom() { + return completedFrom; + } + + public Instant getCompletedUntil() { + return completedUntil; + } + + public Instant[] getCompletedNotWithin() { + return completedNotWithin; + } + + public Instant getCompletedFromNot() { + return completedFromNot; + } + + public Instant getCompletedUntilNot() { + return completedUntilNot; + } + + public String[] getNameIn() { + return nameIn; + } + + public String[] getNameNotIn() { + return nameNotIn; + } + + public String[] getNameLike() { + return nameLike; + } + + public String[] getNameNotLike() { + return nameNotLike; + } + + public String[] getCreatorIn() { + return creatorIn; + } + + public String[] getCreatorNotIn() { + return creatorNotIn; + } + + public String[] getCreatorLike() { + return creatorLike; + } + + public String[] getCreatorNotLike() { + return creatorNotLike; + } + + public String[] getNoteLike() { + return noteLike; + } + + public String[] getNoteNotLike() { + return noteNotLike; + } + + public String[] getDescriptionLike() { + return descriptionLike; + } + + public String[] getDescriptionNotLike() { + return descriptionNotLike; + } + + public int[] getPriorityIn() { + return priorityIn; + } + + public int[] getPriorityNotIn() { + return priorityNotIn; + } + + public Integer[] getPriorityWithin() { + return priorityWithin; + } + + public Integer getPriorityFrom() { + return priorityFrom; + } + + public Integer getPriorityUntil() { + return priorityUntil; + } + + public Integer[] getPriorityNotWithin() { + return priorityNotWithin; + } + + public Integer getPriorityNotFrom() { + return priorityNotFrom; + } + + public Integer getPriorityNotUntil() { + return priorityNotUntil; + } + + public TaskState[] getStateIn() { + return stateIn; + } + + public TaskState[] getStateNotIn() { + return stateNotIn; + } + + public String[] getClassificationIdIn() { + return classificationIdIn; + } + + public String[] getClassificationIdNotIn() { + return classificationIdNotIn; + } + + public String[] getClassificationKeyIn() { + return classificationKeyIn; + } + + public String[] getClassificationKeyNotIn() { + return classificationKeyNotIn; + } + + public String[] getClassificationKeyLike() { + return classificationKeyLike; + } + + public String[] getClassificationKeyNotLike() { + return classificationKeyNotLike; + } + + public String[] getClassificationParentKeyIn() { + return classificationParentKeyIn; + } + + public String[] getClassificationParentKeyNotIn() { + return classificationParentKeyNotIn; + } + + public String[] getClassificationParentKeyLike() { + return classificationParentKeyLike; + } + + public String[] getClassificationParentKeyNotLike() { + return classificationParentKeyNotLike; + } + + public String[] getClassificationCategoryIn() { + return classificationCategoryIn; + } + + public String[] getClassificationCategoryNotIn() { + return classificationCategoryNotIn; + } + + public String[] getClassificationCategoryLike() { + return classificationCategoryLike; + } + + public String[] getClassificationCategoryNotLike() { + return classificationCategoryNotLike; + } + + public String[] getClassificationNameIn() { + return classificationNameIn; + } + + public String[] getClassificationNameNotIn() { + return classificationNameNotIn; + } + + public String[] getClassificationNameLike() { + return classificationNameLike; + } + + public String[] getClassificationNameNotLike() { + return classificationNameNotLike; + } + + public String[] getWorkbasketIdIn() { + return workbasketIdIn; + } + + public String[] getWorkbasketIdNotIn() { + return workbasketIdNotIn; + } + + public String[] getWorkbasketKeyIn() { + return workbasketKeyIn; + } + + public String[] getWorkbasketKeyNotIn() { + return workbasketKeyNotIn; + } + + public String getDomain() { + return domain; + } + + public String[] getBusinessProcessIdIn() { + return businessProcessIdIn; + } + + public String[] getBusinessProcessIdNot() { + return businessProcessIdNot; + } + + public String[] getBusinessProcessIdLike() { + return businessProcessIdLike; + } + + public String[] getBusinessProcessIdNotLike() { + return businessProcessIdNotLike; + } + + public String[] getParentBusinessProcessIdIn() { + return parentBusinessProcessIdIn; + } + + public String[] getParentBusinessProcessIdNotIn() { + return parentBusinessProcessIdNotIn; + } + + public String[] getParentBusinessProcessIdLike() { + return parentBusinessProcessIdLike; + } + + public String[] getParentBusinessProcessIdNotLike() { + return parentBusinessProcessIdNotLike; + } + + public String[] getOwnerIn() { + return ownerIn; + } + + public String[] getOwnerNotIn() { + return ownerNotIn; + } + + public String[] getOwnerLike() { + return ownerLike; + } + + public String[] getOwnerNotLike() { + return ownerNotLike; + } + + public String getOwnerNull() { + return ownerNull; + } + + public ObjectReference[] getPrimaryObjectReferenceIn() { + return primaryObjectReferenceIn; + } + + public String[] getPorCompanyIn() { + return porCompanyIn; + } + + public String[] getPorCompanyNotIn() { + return porCompanyNotIn; + } + + public String[] getPorCompanyLike() { + return porCompanyLike; + } + + public String[] getPorCompanyNotLike() { + return porCompanyNotLike; + } + + public String[] getPorSystemIn() { + return porSystemIn; + } + + public String[] getPorSystemNotIn() { + return porSystemNotIn; + } + + public String[] getPorSystemLike() { + return porSystemLike; + } + + public String[] getPorSystemNotLike() { + return porSystemNotLike; + } + + public String[] getPorInstanceIn() { + return porInstanceIn; + } + + public String[] getPorInstanceNotIn() { + return porInstanceNotIn; + } + + public String[] getPorInstanceLike() { + return porInstanceLike; + } + + public String[] getPorInstanceNotLike() { + return porInstanceNotLike; + } + + public String[] getPorTypeIn() { + return porTypeIn; + } + + public String[] getPorTypeNotIn() { + return porTypeNotIn; + } + + public String[] getPorTypeLike() { + return porTypeLike; + } + + public String[] getPorTypeNotLike() { + return porTypeNotLike; + } + + public String[] getPorValueIn() { + return porValueIn; + } + + public String[] getPorValueNotIn() { + return porValueNotIn; + } + + public String[] getPorValueLike() { + return porValueLike; + } + + public String[] getPorValueNotLike() { + return porValueNotLike; + } + + public ObjectReference[] getSecondaryObjectReferenceIn() { + return secondaryObjectReferenceIn; + } + + public String[] getSorCompanyIn() { + return sorCompanyIn; + } + + public String[] getSorCompanyLike() { + return sorCompanyLike; + } + + public String[] getSorSystemIn() { + return sorSystemIn; + } + + public String[] getSorSystemLike() { + return sorSystemLike; + } + + public String[] getSorInstanceIn() { + return sorInstanceIn; + } + + public String[] getSorInstanceLike() { + return sorInstanceLike; + } + + public String[] getSorTypeIn() { + return sorTypeIn; + } + + public String[] getSorTypeLike() { + return sorTypeLike; + } + + public String[] getSorValueIn() { + return sorValueIn; + } + + public String[] getSorValueLike() { + return sorValueLike; + } + + public Boolean getRead() { + return isRead; + } + + public Boolean getTransferred() { + return isTransferred; + } + + public String[] getAttachmentClassificationIdIn() { + return attachmentClassificationIdIn; + } + + public String[] getAttachmentClassificationIdNotIn() { + return attachmentClassificationIdNotIn; + } + + public String[] getAttachmentClassificationKeyIn() { + return attachmentClassificationKeyIn; + } + + public String[] getAttachmentClassificationKeyNotIn() { + return attachmentClassificationKeyNotIn; + } + + public String[] getAttachmentClassificationKeyLike() { + return attachmentClassificationKeyLike; + } + + public String[] getAttachmentClassificationKeyNotLike() { + return attachmentClassificationKeyNotLike; + } + + public String[] getAttachmentClassificationNameIn() { + return attachmentClassificationNameIn; + } + + public String[] getAttachmentClassificationNameNotIn() { + return attachmentClassificationNameNotIn; + } + + public String[] getAttachmentClassificationNameLike() { + return attachmentClassificationNameLike; + } + + public String[] getAttachmentClassificationNameNotLike() { + return attachmentClassificationNameNotLike; + } + + public String[] getAttachmentChannelIn() { + return attachmentChannelIn; + } + + public String[] getAttachmentChannelNotIn() { + return attachmentChannelNotIn; + } + + public String[] getAttachmentChannelLike() { + return attachmentChannelLike; + } + + public String[] getAttachmentChannelNotLike() { + return attachmentChannelNotLike; + } + + public String[] getAttachmentReferenceIn() { + return attachmentReferenceIn; + } + + public String[] getAttachmentReferenceNotIn() { + return attachmentReferenceNotIn; + } + + public String[] getAttachmentReferenceLike() { + return attachmentReferenceLike; + } + + public String[] getAttachmentReferenceNotLike() { + return attachmentReferenceNotLike; + } + + public Instant[] getAttachmentReceivedWithin() { + return attachmentReceivedWithin; + } + + public Instant[] getAttachmentReceivedNotWithin() { + return attachmentReceivedNotWithin; + } + + public Boolean getWithoutAttachment() { + return withoutAttachment; + } + + public CallbackState[] getCallbackStateIn() { + return callbackStateIn; + } + + public CallbackState[] getCallbackStateNotIn() { + return callbackStateNotIn; + } + + public WildcardSearchField[] getWildcardSearchFieldIn() { + return wildcardSearchFieldIn; + } + + public String getWildcardSearchValue() { + return wildcardSearchValue; + } + + public String[] getTaskIdNotIn() { + return taskIdNotIn; + } + // region id /** Filter by task id. This is an exact match. */ + @Schema(name = "task-id", description = "Filter by task id. This is an exact match.") @JsonProperty("task-id") private final String[] taskIdIn; /** Filter by what the task id shouldn't be. This is an exact match. */ + @Schema( + name = "task-id-not", + description = "Filter by what the task id shouldn't be. This is an exact match.") @JsonProperty("task-id-not") private final String[] taskIdNotIn; // endregion // region externalId /** Filter by the external id of the Task. This is an exact match. */ + @Schema( + name = "external-id", + description = "Filter by the external id of the Task. This is an exact match.") @JsonProperty("external-id") private final String[] externalIdIn; /** Filter by what the external id of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "external-id-not", + description = + "Filter by what the external id of the Task shouldn't be. This is an exact match.") @JsonProperty("external-id-not") private final String[] externalIdNotIn; // endregion @@ -47,6 +679,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'received-from' or 'received-until'. */ + @Schema( + name = "received", + description = + "Filter by a time interval within which the Task was received. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This " + + "parameter can't be used together with 'received-from' or 'received-until'.") @JsonProperty("received") private final Instant[] receivedWithin; @@ -57,6 +695,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'received'. */ + @Schema( + name = "receivedFrom", + description = + "Filter since a given received timestamp.

The format is ISO-8601." + + "

This parameter can't be used together with 'received'.") @JsonProperty("received-from") private final Instant receivedFrom; @@ -67,6 +710,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'received'. */ + @Schema( + name = "received-until", + description = + "Filter until a given received timestamp.

The format is ISO-8601." + + "

This parameter can't be used together with 'received'.") @JsonProperty("received-until") private final Instant receivedUntil; @@ -79,6 +727,13 @@ public class TaskQueryFilterParameter implements QueryParameter *

This parameter can't be used together with 'received-not-in-from' or * 'received-not-in-until'. */ + @Schema( + name = "received-not", + description = + "Filter by a time interval within which the Task wasn't received. To " + + "create an open interval you can just leave it blank.

The format is ISO-8601." + + "

This parameter can't be used together with 'received-not-in-from' or " + + "'received-not-in-until'.") @JsonProperty("received-not") private final Instant[] receivedNotIn; @@ -89,6 +744,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'received-not-in'. */ + @Schema( + name = "received-from-not", + description = + "Filter since a given timestamp where it wasn't received.

The format is " + + "ISO-8601.

This parameter can't be used together with 'received-not-in'.") @JsonProperty("received-from-not") private final Instant receivedFromNot; @@ -99,6 +759,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'received-not-in'. */ + @Schema( + name = "received-until-not", + description = + "Filter until a given timestamp where it wasn't received.

The format is " + + "ISO-8601.

This parameter can't be used together with 'received-not-in'.") @JsonProperty("received-until-not") private final Instant receivedUntilNot; // endregion @@ -111,6 +776,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created-from' or 'created-until'. */ + @Schema( + name = "created", + description = + "Filter by a time interval within which the Task was created. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This " + + "parameter can't be used together with 'created-from' or 'created-until'.") @JsonProperty("created") private final Instant[] createdWithin; @@ -121,6 +792,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created'. */ + @Schema( + name = "created-from", + description = + "Filter since a given created timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'created'.") @JsonProperty("created-from") private final Instant createdFrom; @@ -131,6 +807,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created'. */ + @Schema( + name = "created-until", + description = + "Filter until a given created timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'created'.") @JsonProperty("created-until") private final Instant createdUntil; @@ -142,6 +823,13 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created-not-in-from' or 'created-not-in-until'. */ + @Schema( + name = "created-not", + description = + "Filter by a time interval within which the Task wasn't created. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This " + + "parameter can't be used together with 'created-not-in-from' or " + + "'created-not-in-until'.") @JsonProperty("created-not") private final Instant[] createdNotWithin; @@ -152,6 +840,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created-not-in'. */ + @Schema( + name = "created-from-not", + description = + "Filter not since a given timestamp where it wasn't created.

The format is ISO-8601." + + "

This parameter can't be used together with 'created-not-in'.") @JsonProperty("created-from-not") private final Instant createdFromNot; @@ -162,6 +855,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'created-not-in'. */ + @Schema( + name = "created-until-not", + description = + "Filter not until a given timestamp where it wasn't created.

The format is ISO-8601." + + "

This parameter can't be used together with 'created-not-in'.") @JsonProperty("created-until-not") private final Instant createdUntilNot; // endregion @@ -172,6 +870,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "claimed", + description = + "Filter by a time interval within which the Task was claimed. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("claimed") private final Instant[] claimedWithin; @@ -181,6 +884,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "claimed-not", + description = + "Filter by a time interval within which the Task wasn't claimed. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("claimed-not") private final Instant[] claimedNotWithin; // endregion @@ -191,6 +899,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "modified", + description = + "Filter by a time interval within which the Task was modified. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("modified") private final Instant[] modifiedWithin; @@ -200,6 +913,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "modified-not", + description = + "Filter by a time interval within which the Task wasn't modified. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("modified-not") private final Instant[] modifiedNotWithin; // endregion @@ -212,6 +930,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned-from' or 'planned-until'. */ + @Schema( + name = "planned", + description = + "Filter by a time interval within which the Task was planned. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This " + + "parameter can't be used together with 'planned-from' or 'planned-until'.") @JsonProperty("planned") private final Instant[] plannedWithin; @@ -222,6 +946,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned'. */ + @Schema( + name = "planned-from", + description = + "Filter since a given planned timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'planned'.") @JsonProperty("planned-from") private final Instant plannedFrom; @@ -232,6 +961,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned'. */ + @Schema( + name = "planned-until", + description = + "Filter until a given planned timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'planned'.") @JsonProperty("planned-until") private final Instant plannedUntil; @@ -243,6 +977,13 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned-not-in-from' or 'planned-not-in-until'. */ + @Schema( + name = "planned-not", + description = + "Filter by a time interval within which the Task was planned. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This " + + "parameter can't be used together with 'planned-not-in-from' or " + + "'planned-not-in-until'.") @JsonProperty("planned-not") private final Instant[] plannedNotWithin; @@ -253,6 +994,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned-not-in'. */ + @Schema( + name = "planned-from-not", + description = + "Filter since a given timestamp where it wasn't planned.

The format is ISO-8601." + + "

This parameter can't be used together with 'planned-not-in'.") @JsonProperty("planned-from-not") private final Instant plannedFromNot; @@ -263,6 +1009,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'planned-not-in'. */ + @Schema( + name = "planned-until-not", + description = + "Filter until a given timestamp where it wasn't planned.

The format is ISO-8601." + + "

This parameter can't be used together with 'planned-not-in'.") @JsonProperty("planned-until-not") private final Instant plannedUntilNot; // endregion @@ -275,6 +1026,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due-from' or 'due-until'. */ + @Schema( + name = "due", + description = + "Filter by a time interval within which the Task was due. To create an open interval " + + "you can just leave it blank.

The format is ISO-8601.

This parameter can't be" + + " used together with 'due-from' or 'due-until'.") @JsonProperty("due") private final Instant[] dueWithin; @@ -285,6 +1042,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due'. */ + @Schema( + name = "due-from", + description = + "Filter since a given due timestamp.

The format is ISO-8601.

This parameter can't " + + "be used together with 'due'.") @JsonProperty("due-from") private final Instant dueFrom; @@ -295,6 +1057,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due'. */ + @Schema( + name = "due-until", + description = + "Filter until a given due timestamp.

The format is ISO-8601.

This parameter can't " + + "be used together with 'due'.") @JsonProperty("due-until") private final Instant dueUntil; @@ -306,6 +1073,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due-not-in-from' or 'due-not-in-until'. */ + @Schema( + name = "due-not", + description = + "Filter by a time interval within which the Task wasn't due. To create an open interval" + + " you can just leave it blank.

The format is ISO-8601.

This parameter can't be" + + " used together with 'due-not-in-from' or 'due-not-in-until'.") @JsonProperty("due-not") private final Instant[] dueNotWithin; @@ -316,6 +1089,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due-not-in'. */ + @Schema( + name = "due-from-not", + description = + "Filter since a given timestamp where it isn't due.

The format is ISO-8601.

This " + + "parameter can't be used together with 'due-not-in'.") @JsonProperty("due-from-not") private final Instant dueFromNot; @@ -326,6 +1104,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'due-not-in'. */ + @Schema( + name = "due-until-not", + description = + "Filter until a given timestamp where it isn't due.

The format is ISO-8601.

This " + + "parameter can't be used together with 'due-not-in'.") @JsonProperty("due-until-not") private final Instant dueUntilNot; // endregion @@ -338,6 +1121,12 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'completed-from' or 'completed-until'. */ + @Schema( + name = "completed", + description = + "Filter by a time interval within which the Task was completed. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This parameter" + + " can't be used together with 'completed-from' or 'completed-until'.") @JsonProperty("completed") private final Instant[] completedWithin; @@ -348,6 +1137,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'completed'. */ + @Schema( + name = "completed-from", + description = + "Filter since a given completed timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'completed'.") @JsonProperty("completed-from") private final Instant completedFrom; @@ -358,6 +1152,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'completed'. */ + @Schema( + name = "completed-until", + description = + "Filter until a given completed timestamp.

The format is ISO-8601.

This parameter " + + "can't be used together with 'completed'.") @JsonProperty("completed-until") private final Instant completedUntil; @@ -370,6 +1169,12 @@ public class TaskQueryFilterParameter implements QueryParameter *

This parameter can't be used together with 'completed-not-in-from' or * 'completed-not-in-until'. */ + @Schema( + name = "completed-not", + description = + "Filter by a time interval within which the Task wasn't completed. To create an open " + + "interval you can just leave it blank.

The format is ISO-8601.

This parameter " + + "can't be used together with 'completed-not-in-from' or 'completed-not-in-until'.") @JsonProperty("completed-not") private final Instant[] completedNotWithin; @@ -380,6 +1185,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'completed-not-in'. */ + @Schema( + name = "completed-from-not", + description = + "Filter since a given timestamp where it wasn't completed.

The format is ISO-8601. " + + "

This parameter can't be used together with 'completed-not-in'.") @JsonProperty("completed-from-not") private final Instant completedFromNot; @@ -390,15 +1200,24 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This parameter can't be used together with 'completed-not-in'. */ + @Schema( + name = "completed-until-not", + description = + "Filter until a given timestamp where it wasn't completed.

The format is ISO-8601. " + + "

This parameter can't be used together with 'completed-not-in'.") @JsonProperty("completed-until-not") private final Instant completedUntilNot; // endregion // region name /** Filter by the name of the Task. This is an exact match. */ + @Schema(name = "name", description = "Filter by the name of the Task. This is an exact match.") @JsonProperty("name") private final String[] nameIn; /** Filter by what the name of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "name-not", + description = "Filter by what the name of the Task shouldn't be. This is an exact match.") @JsonProperty("name-not") private final String[] nameNotIn; @@ -407,6 +1226,12 @@ public class TaskQueryFilterParameter implements QueryParameter * and end of the requested value). Further SQL "LIKE" wildcard characters will be resolved * correctly. */ + @Schema( + name = "name-like", + description = + "Filter by the name of the Task. This results in a substring search (% is appended to " + + "the front and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("name-like") private final String[] nameLike; @@ -415,15 +1240,25 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "name-not-like", + description = + "Filter by what the name of the Task shouldn't be. This results in a substring search " + + "(% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("name-not-like") private final String[] nameNotLike; // endregion // region creator /** Filter by creator of the Task. This is an exact match. */ + @Schema(name = "creator", description = "Filter by creator of the Task. This is an exact match.") @JsonProperty("creator") private final String[] creatorIn; /** Filter by what the creator of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "creator-not", + description = "Filter by what the creator of the Task shouldn't be. This is an exact match.") @JsonProperty("creator-not") private final String[] creatorNotIn; @@ -432,6 +1267,12 @@ public class TaskQueryFilterParameter implements QueryParameter * front and end of the requested value). Further SQL "LIKE" wildcard characters will be resolved * correctly. */ + @Schema( + name = "creator-like", + description = + "Filter by the creator of the Task. This results in a substring search (% is appended to" + + " the front and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("creator-like") private final String[] creatorLike; @@ -440,6 +1281,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "creator-not-like", + description = + "Filter by what the creator of the Task shouldn't be. This results in a substring " + + "search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("creator-not-like") private final String[] creatorNotLike; // endregion @@ -449,6 +1296,12 @@ public class TaskQueryFilterParameter implements QueryParameter * and end of the requested value). Further SQL "LIKE" wildcard characters will be resolved * correctly. */ + @Schema( + name = "note-like", + description = + "Filter by the note of the Task. This results in a substring search (% is appended to" + + " the front and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("note-like") private final String[] noteLike; @@ -457,6 +1310,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "note-not-like", + description = + "Filter by what the note of the Task shouldn't be. This results in a substring search " + + "(% is appended to the front and end of the requested value). Further SQL \"LIKE\"" + + " wildcard characters will be resolved correctly.") @JsonProperty("note-not-like") private final String[] noteNotLike; // endregion @@ -466,6 +1325,12 @@ public class TaskQueryFilterParameter implements QueryParameter * front and end of the requested value). Further SQL "LIKE" wildcard characters will be resolved * correctly. */ + @Schema( + name = "description-like", + description = + "Filter by the description of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("description-like") private final String[] descriptionLike; @@ -474,66 +1339,113 @@ public class TaskQueryFilterParameter implements QueryParameter * is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "description-not-like", + description = + "Filter by what the description of the Task shouldn't be. This results in a substring " + + "search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("description-not-like") private final String[] descriptionNotLike; // endregion // region priority /** Filter by the priority of the Task. This is an exact match. */ + @Schema( + name = "priority", + description = "Filter by the priority of the Task. This is an exact match.") @JsonProperty("priority") private final int[] priorityIn; /** Filter by what the priority of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "priority-not", + description = "Filter by what the priority of the Task shouldn't be. This is an exact match.") @JsonProperty("priority-not") private final int[] priorityNotIn; /** Filter by the range of values of the priority field of the Task. */ + @Schema( + name = "priority-within", + description = "Filter by the range of values of the priority field of the Task.") @JsonProperty("priority-within") private final Integer[] priorityWithin; /** Filter by priority starting from the given value (inclusive). */ + @Schema( + name = "priority-from", + description = "Filter by priority starting from the given value (inclusive).") @JsonProperty("priority-from") private final Integer priorityFrom; /** Filter by priority up to the given value (inclusive). */ + @Schema( + name = "priority-until", + description = "Filter by priority up to the given value (inclusive).") @JsonProperty("priority-until") private final Integer priorityUntil; /** Filter by exclusing the range of values of the priority field of the Task. */ + @Schema( + name = "priority-not-within", + description = "Filter by exclusing the range of values of the priority field of the Task.") @JsonProperty("priority-not-within") private final Integer[] priorityNotWithin; /** Filter by excluding priority starting from the given value (inclusive). */ + @Schema( + name = "priority-not-from", + description = "Filter by excluding priority starting from the given value (inclusive).") @JsonProperty("priority-not-from") private final Integer priorityNotFrom; /** Filter by excluding priority up to the given value (inclusive). */ + @Schema( + name = "priority-not-until", + description = "Filter by excluding priority up to the given value (inclusive).") @JsonProperty("priority-not-until") private final Integer priorityNotUntil; // endregion // region state /** Filter by the Task state. This is an exact match. */ + @Schema(name = "state", description = "Filter by the Task state. This is an exact match.") @JsonProperty("state") private final TaskState[] stateIn; /** Filter by what the Task state shouldn't be. This is an exact match. */ + @Schema( + name = "state-not", + description = "Filter by what the Task state shouldn't be. This is an exact match.") @JsonProperty("state-not") private final TaskState[] stateNotIn; // endregion // region classificationId /** Filter by the classification id of the Task. This is an exact match. */ + @Schema( + name = "classification-id", + description = "Filter by the classification id of the Task. This is an exact match.") @JsonProperty("classification-id") private final String[] classificationIdIn; /** Filter by what the classification id of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "classification-id-not", + description = + "Filter by what the classification id of the Task shouldn't be. This is an exact match.") @JsonProperty("classification-id-not") private final String[] classificationIdNotIn; // endregion // region classificationKey /** Filter by the classification key of the Task. This is an exact match. */ + @Schema( + name = "classification-key", + description = "Filter by the classification key of the Task. This is an exact match.") @JsonProperty("classification-key") private final String[] classificationKeyIn; /** Filter by the classification key of the Task. This is an exact match. */ + @Schema( + name = "classification-key-not", + description = "Filter by the classification key of the Task. This is an exact match.") @JsonProperty("classification-key-not") private final String[] classificationKeyNotIn; @@ -542,6 +1454,12 @@ public class TaskQueryFilterParameter implements QueryParameter * to the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "classification-key-like", + description = + "Filter by the classification key of the Task. This results in a substring search (% is" + + " appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("classification-key-like") private final String[] classificationKeyLike; @@ -550,6 +1468,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "classification-key-not-like", + description = + "Filter by what the classification key of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("classification-key-not-like") private final String[] classificationKeyNotLike; // endregion @@ -558,6 +1482,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by the key of the parent Classification of the Classification of the Task. This is an * exact match. */ + @Schema( + name = "classification-parent-key", + description = + "Filter by the key of the parent Classification of the Classification of the Task. This" + + " is an exact match.") @JsonProperty("classification-parent-key") private final String[] classificationParentKeyIn; @@ -565,6 +1494,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the key of the parent Classification of the Classification of the Task shouldn't * be. This is an exact match. */ + @Schema( + name = "classification-parent-key-not", + description = + "Filter by what the key of the parent Classification of the Classification of the Task " + + "shouldn't be. This is an exact match.") @JsonProperty("classification-parent-key-not") private final String[] classificationParentKeyNotIn; @@ -573,6 +1507,13 @@ public class TaskQueryFilterParameter implements QueryParameter * in a substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "classification-parent-key-like", + description = + "Filter by the key of the parent Classification of the Classification of the Task. This" + + " results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("classification-parent-key-like") private final String[] classificationParentKeyLike; @@ -581,17 +1522,32 @@ public class TaskQueryFilterParameter implements QueryParameter * be. This results in a substring search (% is appended to the front and end of the requested * value). Further SQL "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "classification-parent-key-not-like", + description = + "Filter by what the key of the parent Classification of the Classification of the Task " + + "shouldn't be. This results in a substring search (% is appended to the front and " + + "end of the requested value). Further SQL \"LIKE\" wildcard characters will be " + + "resolved correctly.") @JsonProperty("classification-parent-key-not-like") private final String[] classificationParentKeyNotLike; // endregion // region classificationCategory /** Filter by the classification category of the Task. This is an exact match. */ + @Schema( + name = "classification-category", + description = "Filter by the classification category of the Task. This is an exact match.") @JsonProperty("classification-category") private final String[] classificationCategoryIn; /** * Filter by what the classification category of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "classification-category-not", + description = + "Filter by what the classification category of the Task shouldn't be. This is an exact " + + "match.") @JsonProperty("classification-category-not") private final String[] classificationCategoryNotIn; @@ -600,6 +1556,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "classification-category-like", + description = + "Filter by the classification category of the Task. This results in a substring search " + + "(% is appended to the front and end of the requested value). Further SQL \"LIKE\"" + + " wildcard characters will be resolved correctly.") @JsonProperty("classification-category-like") private final String[] classificationCategoryLike; @@ -608,15 +1570,29 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "classification-category-not-like", + description = + "Filter by what the classification category of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("classification-category-not-like") private final String[] classificationCategoryNotLike; // endregion // region classificationName /** Filter by the classification name of the Task. This is an exact match. */ + @Schema( + name = "classification-name", + description = "Filter by the classification name of the Task. This is an exact match.") @JsonProperty("classification-name") private final String[] classificationNameIn; /** Filter by what the classification name of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "classification-name-not", + description = + "Filter by what the classification name of the Task shouldn't be. This is an exact " + + "match.") @JsonProperty("classification-name-not") private final String[] classificationNameNotIn; @@ -625,6 +1601,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "classification-name-like", + description = + "Filter by the classification name of the Task. This results in a substring search (% " + + "is appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("classification-name-like") private final String[] classificationNameLike; @@ -633,15 +1615,28 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "classification-name-not-like", + description = + "Filter by what the classification name of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("classification-name-not-like") private final String[] classificationNameNotLike; // endregion // region workbasketId /** Filter by workbasket id of the Task. This is an exact match. */ + @Schema( + name = "workbasket-id", + description = "Filter by workbasket id of the Task. This is an exact match.") @JsonProperty("workbasket-id") private final String[] workbasketIdIn; /** Filter by what the workbasket id of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "workbasket-id-not", + description = + "Filter by what the workbasket id of the Task shouldn't be. This is an exact match.") @JsonProperty("workbasket-id-not") private final String[] workbasketIdNotIn; // endregion @@ -650,6 +1645,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by workbasket keys of the Task. This parameter can only be used in combination with * 'domain' */ + @Schema( + name = "workbasket-key", + description = + "Filter by workbasket keys of the Task. This parameter can only be used in combination " + + "with 'domain'") @JsonProperty("workbasket-key") private final String[] workbasketKeyIn; @@ -657,19 +1657,33 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the workbasket keys of the Task aren't. This parameter can only be used in * combination with 'domain' */ + @Schema( + name = "workbasket-key-not", + description = + "Filter by what the workbasket keys of the Task aren't. This parameter can only be used " + + "in combination with 'domain'") @JsonProperty("workbasket-key-not") private final String[] workbasketKeyNotIn; /** Filter by domain of the Task. This is an exact match. */ + @Schema(name = "domain", description = "Filter by domain of the Task. This is an exact match.") @JsonProperty("domain") private final String domain; // endregion // region businessProcessId /** Filter by the business process id of the Task. This is an exact match. */ + @Schema( + name = "business-process-id", + description = "Filter by the business process id of the Task. This is an exact match.") @JsonProperty("business-process-id") private final String[] businessProcessIdIn; /** Filter by what the business process id of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "business-process-id-not", + description = + "Filter by what the business process id of the Task shouldn't be. This is an exact " + + "match.") @JsonProperty("business-process-id-not") private final String[] businessProcessIdNot; @@ -678,6 +1692,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "business-process-id-like", + description = + "Filter by the business process id of the Task. This results in a substring search (% is" + + " appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("business-process-id-like") private final String[] businessProcessIdLike; @@ -686,18 +1706,32 @@ public class TaskQueryFilterParameter implements QueryParameter * (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "business-process-id-not-like", + description = + "Filter by the business process id of the Task shouldn't be. This results in a substring" + + " search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("business-process-id-not-like") private final String[] businessProcessIdNotLike; // endregion // region parentBusinessProcessId /** Filter by the parent business process id of the Task. This is an exact match. */ + @Schema( + name = "parent-business-process-id", + description = "Filter by the parent business process id of the Task. This is an exact match.") @JsonProperty("parent-business-process-id") private final String[] parentBusinessProcessIdIn; /** * Filter by what the parent business process id of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "parent-business-process-id-not", + description = + "Filter by what the parent business process id of the Task shouldn't be. This is an " + + "exact match.") @JsonProperty("parent-business-process-id-not") private final String[] parentBusinessProcessIdNotIn; @@ -706,6 +1740,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "parent-business-process-id-like", + description = + "Filter by the parent business process id of the Task. This results in a substring " + + "search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("parent-business-process-id-like") private final String[] parentBusinessProcessIdLike; @@ -714,6 +1754,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "parent-business-process-id-not-like", + description = + "Filter by the parent business process id of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("parent-business-process-id-not-like") private final String[] parentBusinessProcessIdNotLike; @@ -724,6 +1770,9 @@ public class TaskQueryFilterParameter implements QueryParameter private final String[] ownerIn; /** Filter by what the owner of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "owner-not", + description = "Filter by what the owner of the Task shouldn't be. This is an exact match.") @JsonProperty("owner-not") private final String[] ownerNotIn; @@ -732,6 +1781,12 @@ public class TaskQueryFilterParameter implements QueryParameter * and end of the requested value). Further SQL "LIKE" wildcard characters will be resolved * correctly. */ + @Schema( + name = "owner-like", + description = + "Filter by the owner of the Task. This results in a substring search (% is appended to " + + "the front and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("owner-like") private final String[] ownerLike; @@ -740,6 +1795,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "owner-not-like", + description = + "Filter by what the owner of the Task shouldn't be. This results in a substring search " + + "(% is appended to the front and end of the requested value). Further SQL \"LIKE\"" + + " wildcard characters will be resolved correctly.") @JsonProperty("owner-not-like") private final String[] ownerNotLike; @@ -747,6 +1808,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by tasks that have no owner. The parameter should exactly be "owner-is-null" without * being followed by "=..." */ + @Schema( + name = "owner-is-null", + description = + "Filter by tasks that have no owner. The parameter should exactly be \"owner-is-null\" " + + "without being followed by \"=...\"") @JsonProperty("owner-is-null") private final String ownerNull; // endregion @@ -757,11 +1823,23 @@ public class TaskQueryFilterParameter implements QueryParameter * specified according to the description of complex parameters in the overview, e.g. * por={"value":"exampleValue"} */ + @Schema( + name = "por", + description = + "Filter by the primary object reference of the Task. This is an exact match. \"por\" is" + + " a parameter of complex type. Its following attributes from por[].id to " + + "por[].value can be specified according to the description of complex parameters " + + "in the overview, e.g. por={\"value\":\"exampleValue\"}") @JsonProperty("por") private final ObjectReference[] primaryObjectReferenceIn; // endregion // region primaryObjectReferenceCompany /** Filter by the company of the primary object reference of the Task. This is an exact match. */ + @Schema( + name = "por-company", + description = + "Filter by the company of the primary object reference of the Task. This is an exact " + + "match.") @JsonProperty("por-company") private final String[] porCompanyIn; @@ -769,6 +1847,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the company of the primary object reference of the Task shouldn't be. This is an * exact match. */ + @Schema( + name = "por-company-not", + description = + "Filter by what the company of the primary object reference of the Task shouldn't be. " + + "This is an exact match.") @JsonProperty("por-company-not") private final String[] porCompanyNotIn; @@ -777,6 +1860,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "por-company-like", + description = + "Filter by the company of the primary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("por-company-like") private final String[] porCompanyLike; @@ -785,11 +1874,23 @@ public class TaskQueryFilterParameter implements QueryParameter * results in a substring search (% is appended to the front and end of the requested value). * Further SQL "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-company-not-like", + description = + "Filter by what the company of the primary object reference of the Task shouldn't be. " + + "This results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("por-company-not-like") private final String[] porCompanyNotLike; // endregion // region primaryObjectReferenceSystem /** Filter by the system of the primary object reference of the Task. This is an exact match. */ + @Schema( + name = "por-system", + description = + "Filter by the system of the primary object reference of the Task. This is an exact " + + "match.") @JsonProperty("por-system") private final String[] porSystemIn; @@ -797,6 +1898,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the system of the primary object reference of the Task shouldn't be. This is an * exact match. */ + @Schema( + name = "por-system-not", + description = + "Filter by what the system of the primary object reference of the Task shouldn't be. " + + "This is an exact match.") @JsonProperty("por-system-not") private final String[] porSystemNotIn; @@ -805,6 +1911,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "por-system-like", + description = + "Filter by the system of the primary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("por-system-like") private final String[] porSystemLike; @@ -813,6 +1925,13 @@ public class TaskQueryFilterParameter implements QueryParameter * results in a substring search (% is appended to the front and end of the requested value). * Further SQL "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-system-not-like", + description = + "Filter by what the system of the primary object reference of the Task shouldn't be. " + + "This results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("por-system-not-like") private final String[] porSystemNotLike; // endregion @@ -821,6 +1940,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by the system instance of the primary object reference of the Task. This is an exact * match. */ + @Schema( + name = "por-instance", + description = + "Filter by the system instance of the primary object reference of the Task. This is an " + + "exact match.") @JsonProperty("por-instance") private final String[] porInstanceIn; @@ -828,6 +1952,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the system instance of the primary object reference of the Task shouldn't be. * This is an exact match. */ + @Schema( + name = "por-instance-not", + description = + "Filter by what the system instance of the primary object reference of the Task " + + "shouldn't be. This is an exact match.") @JsonProperty("por-instance-not") private final String[] porInstanceNotIn; @@ -836,6 +1965,12 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-instance-like", + description = + "Filter by the system instance of the primary object reference of the Task. This results" + + " in a substring search (% is appended to the front and end of the requested " + + "value). Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("por-instance-like") private final String[] porInstanceLike; @@ -844,11 +1979,22 @@ public class TaskQueryFilterParameter implements QueryParameter * This results in a substring search (% is appended to the front and end of the requested value). * Further SQL "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-instance-not-like", + description = + "Filter by what the system instance of the primary object reference of the Task " + + "shouldn't be. This results in a substring search (% is appended to the front and" + + " end of the requested value). Further SQL \"LIKE\" wildcard characters will be " + + "resolved correctly.") @JsonProperty("por-instance-not-like") private final String[] porInstanceNotLike; // endregion // region primaryObjectReferenceSystemType /** Filter by the type of the primary object reference of the Task. This is an exact match. */ + @Schema( + name = "por-type", + description = + "Filter by the type of the primary object reference of the Task. This is an exact match.") @JsonProperty("por-type") private final String[] porTypeIn; @@ -856,6 +2002,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the type of the primary object reference of the Task shouldn't be. This is an * exact match. */ + @Schema( + name = "por-type-not", + description = + "Filter by what the type of the primary object reference of the Task shouldn't be. This " + + "is an exact match.") @JsonProperty("por-type-not") private final String[] porTypeNotIn; @@ -864,6 +2015,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "por-type-like", + description = + "Filter by the type of the primary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value)." + + " Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("por-type-like") private final String[] porTypeLike; @@ -872,11 +2029,23 @@ public class TaskQueryFilterParameter implements QueryParameter * in a substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-type-not-like", + description = + "Filter by what the type of the primary object reference of the Task shouldn't be. This " + + "results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("por-type-not-like") private final String[] porTypeNotLike; // endregion // region primaryObjectReferenceSystemValue /** Filter by the value of the primary object reference of the Task. This is an exact match. */ + @Schema( + name = "por-value", + description = + "Filter by the value of the primary object reference of the Task. This is an exact " + + "match.") @JsonProperty("por-value") private final String[] porValueIn; @@ -884,6 +2053,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the value of the primary object reference of the Task shouldn't be. This is an * exact match. */ + @Schema( + name = "por-value-not", + description = + "Filter by what the value of the primary object reference of the Task shouldn't be. This" + + " is an exact match.") @JsonProperty("por-value-not") private final String[] porValueNotIn; @@ -892,6 +2066,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "por-value-like", + description = + "Filter by the value of the primary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("por-value-like") private final String[] porValueLike; @@ -900,6 +2080,13 @@ public class TaskQueryFilterParameter implements QueryParameter * in a substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "por-value-not-like", + description = + "Filter by what the value of the primary object reference of the Task shouldn't be. This" + + " results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("por-value-not-like") private final String[] porValueNotLike; // endregion @@ -910,6 +2097,13 @@ public class TaskQueryFilterParameter implements QueryParameter * specified according to the description of complex parameters in the overview, e.g. * sor={"value":"exampleValue"} */ + @Schema( + name = "sor", + description = + "Filter by the primary object reference of the Task. This is an exact match. \"sor\" is" + + " a parameter of complex type. Its following attributes from sor[].id to " + + "sor[].value can be specified according to the description of complex parameters" + + " in the overview, e.g. sor={\"value\":\"exampleValue\"}") @JsonProperty("sor") private final ObjectReference[] secondaryObjectReferenceIn; // endregion @@ -917,6 +2111,11 @@ public class TaskQueryFilterParameter implements QueryParameter /** * Filter by the company of the secondary object reference of the Task. This is an exact match. */ + @Schema( + name = "sor-company", + description = + "Filter by the company of the secondary object reference of the Task. This is an exact " + + "match.") @JsonProperty("sor-company") private final String[] sorCompanyIn; @@ -925,12 +2124,23 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "sor-company-like", + description = + "Filter by the company of the secondary object references of the Task. This results in a" + + " substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("sor-company-like") private final String[] sorCompanyLike; // endregion // region secondaryObjectReferenceSystem /** Filter by the system of the secondary object reference of the Task. This is an exact match. */ + @Schema( + name = "sor-system", + description = + "Filter by the system of the secondary object reference of the Task. This is an exact " + + "match.") @JsonProperty("sor-system") private final String[] sorSystemIn; @@ -939,6 +2149,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "sor-system-like", + description = + "Filter by the system of the secondary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("sor-system-like") private final String[] sorSystemLike; @@ -948,6 +2164,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by the system instance of the secondary object reference of the Task. This is an exact * match. */ + @Schema( + name = "sor-instance", + description = + "Filter by the system instance of the secondary object reference of the Task. This is " + + "an exact match.") @JsonProperty("sor-instance") private final String[] sorInstanceIn; @@ -956,12 +2177,24 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "sor-instance-like", + description = + "Filter by the system instance of the secondary object reference of the Task. This " + + "results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("sor-instance-like") private final String[] sorInstanceLike; // endregion // region secondaryObjectReferenceSystemType /** Filter by the type of the secondary object reference of the Task. This is an exact match. */ + @Schema( + name = "sor-type", + description = + "Filter by the type of the secondary object reference of the Task. This is an exact " + + "match.") @JsonProperty("sor-type") private final String[] sorTypeIn; @@ -970,12 +2203,23 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "sor-type-like", + description = + "Filter by the type of the secondary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("sor-type-like") private final String[] sorTypeLike; // endregion // region primaryObjectReferenceSystemValue /** Filter by the value of the secondary object reference of the Task. This is an exact match. */ + @Schema( + name = "sor-value", + description = + "Filter by the value of the secondary object reference of the Task. This is an exact " + + "match.") @JsonProperty("sor-value") private final String[] sorValueIn; @@ -984,22 +2228,38 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "sor-value-like", + description = + "Filter by the value of the secondary object reference of the Task. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("sor-value-like") private final String[] sorValueLike; // endregion // region read /** Filter by the is read flag of the Task. This is an exact match. */ + @Schema( + name = "is-read", + description = "Filter by the is read flag of the Task. This is an exact match.") @JsonProperty("is-read") private final Boolean isRead; // endregion // region transferred /** Filter by the is transferred flag of the Task. This is an exact match. */ + @Schema( + name = "is-transferred", + description = "Filter by the is transferred flag of the Task. This is an exact match.") @JsonProperty("is-transferred") private final Boolean isTransferred; // endregion // region attachmentClassificationId /** Filter by the attachment classification id of the Task. This is an exact match. */ + @Schema( + name = "attachment-classification-id", + description = + "Filter by the attachment classification id of the Task. This is an exact match.") @JsonProperty("attachment-classification-id") private final String[] attachmentClassificationIdIn; @@ -1007,11 +2267,20 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the attachment classification id of the Task shouldn't be. This is an exact * match. */ + @Schema( + name = "attachment-classification-id-not", + description = + "Filter by what the attachment classification id of the Task shouldn't be. This is an " + + "exact match.") @JsonProperty("attachment-classification-id-not") private final String[] attachmentClassificationIdNotIn; // endregion // region attachmentClassificationKey /** Filter by the attachment classification key of the Task. This is an exact match. */ + @Schema( + name = "attachment-classification-key", + description = + "Filter by the attachment classification key of the Task. This is an exact match.") @JsonProperty("attachment-classification-key") private final String[] attachmentClassificationKeyIn; @@ -1019,6 +2288,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the attachment classification key of the Task shouldn't be. This is an exact * match. */ + @Schema( + name = "attachment-classification-key-not", + description = + "Filter by what the attachment classification key of the Task shouldn't be. This is an " + + "exact match.") @JsonProperty("attachment-classification-key-not") private final String[] attachmentClassificationKeyNotIn; @@ -1027,6 +2301,12 @@ public class TaskQueryFilterParameter implements QueryParameter * is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "attachment-classification-key-like", + description = + "Filter by the attachment classification key of the Task. This results in a substring " + + "search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("attachment-classification-key-like") private final String[] attachmentClassificationKeyLike; @@ -1035,11 +2315,21 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "attachment-classification-key-not-like", + description = + "Filter by what the attachment classification key of the Task shouldn't be. This results" + + " in a substring search (% is appended to the front and end of the requested " + + "value). Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("attachment-classification-key-not-like") private final String[] attachmentClassificationKeyNotLike; // endregion // region attachmentClassificationName /** Filter by the attachment classification name of the Task. This is an exact match. */ + @Schema( + name = "attachment-classification-name", + description = + "Filter by the attachment classification name of the Task. This is an exact match.") @JsonProperty("attachment-classification-name") private final String[] attachmentClassificationNameIn; @@ -1047,6 +2337,11 @@ public class TaskQueryFilterParameter implements QueryParameter * Filter by what the attachment classification name of the Task shouldn't be. This is an exact * match. */ + @Schema( + name = "attachment-classification-name-not", + description = + "Filter by what the attachment classification name of the Task shouldn't be. This is an " + + "exact match.") @JsonProperty("attachment-classification-name-not") private final String[] attachmentClassificationNameNotIn; @@ -1055,6 +2350,12 @@ public class TaskQueryFilterParameter implements QueryParameter * is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "attachment-classification-name-like", + description = + "Filter by the attachment classification name of the Task. This results in a substring " + + "search (% is appended to the front and end of the requested value). Further SQL " + + "\"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("attachment-classification-name-like") private final String[] attachmentClassificationNameLike; @@ -1063,15 +2364,30 @@ public class TaskQueryFilterParameter implements QueryParameter * substring search (% is appended to the front and end of the requested value). Further SQL * "LIKE" wildcard characters will be resolved correctly. */ + @Schema( + name = "attachment-classification-name-not-like", + description = + "Filter by what the attachment classification name of the Task shouldn't be. This " + + "results in a substring search (% is appended to the front and end of the " + + "requested value). Further SQL \"LIKE\" wildcard characters will be resolved " + + "correctly.") @JsonProperty("attachment-classification-name-not-like") private final String[] attachmentClassificationNameNotLike; // endregion // region attachmentChannel /** Filter by the attachment channel of the Task. This is an exact match. */ + @Schema( + name = "attachment-channel", + description = "Filter by the attachment channel of the Task. This is an exact match.") @JsonProperty("attachment-channel") private final String[] attachmentChannelIn; /** Filter by what the attachment channel of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "attachment-channel-not", + description = + "Filter by what the attachment channel of the Task shouldn't be. This is an exact " + + "match.") @JsonProperty("attachment-channel-not") private final String[] attachmentChannelNotIn; @@ -1080,6 +2396,12 @@ public class TaskQueryFilterParameter implements QueryParameter * to the front and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "attachment-channel-like", + description = + "Filter by the attachment channel of the Task. This results in a substring search (% is " + + "appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("attachment-channel-like") private final String[] attachmentChannelLike; @@ -1088,15 +2410,29 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "attachment-channel-not-like", + description = + "Filter by what the attachment channel of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("attachment-channel-not-like") private final String[] attachmentChannelNotLike; // endregion // region attachmentReferenceValue /** Filter by the attachment reference of the Task. This is an exact match. */ + @Schema( + name = "attachment-reference", + description = "Filter by the attachment reference of the Task. This is an exact match.") @JsonProperty("attachment-reference") private final String[] attachmentReferenceIn; /** Filter by what the attachment reference of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "attachment-reference-not", + description = + "Filter by what the attachment reference of the Task shouldn't be. This is an exact " + + "match.") @JsonProperty("attachment-reference-not") private final String[] attachmentReferenceNotIn; @@ -1105,6 +2441,12 @@ public class TaskQueryFilterParameter implements QueryParameter * appended to the front and end of the requested value). Further SQL "LIKE" wildcard characters * will be resolved correctly. */ + @Schema( + name = "attachment-reference-like", + description = + "Filter by the attachment reference of the Task. This results in a substring search (% " + + "is appended to the front and end of the requested value). Further SQL \"LIKE\" " + + "wildcard characters will be resolved correctly.") @JsonProperty("attachment-reference-like") private final String[] attachmentReferenceLike; @@ -1113,6 +2455,12 @@ public class TaskQueryFilterParameter implements QueryParameter * search (% is appended to the front and end of the requested value). Further SQL "LIKE" wildcard * characters will be resolved correctly. */ + @Schema( + name = "attachment-reference-not-like", + description = + "Filter by what the attachment reference of the Task shouldn't be. This results in a " + + "substring search (% is appended to the front and end of the requested value). " + + "Further SQL \"LIKE\" wildcard characters will be resolved correctly.") @JsonProperty("attachment-reference-not-like") private final String[] attachmentReferenceNotLike; // endregion @@ -1123,6 +2471,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "attachment-received", + description = + "Filter by a time interval within which the attachment of the Task was received. To " + + "create an open interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("attachment-received") private final Instant[] attachmentReceivedWithin; @@ -1132,6 +2485,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

The format is ISO-8601. */ + @Schema( + name = "attachment-received-not", + description = + "Filter by a time interval within which the attachment of the Task wasn't received. To " + + "create an open interval you can just leave it blank.

The format is ISO-8601.") @JsonProperty("attachment-received-not") private final Instant[] attachmentReceivedNotWithin; // endregion @@ -1140,15 +2498,27 @@ public class TaskQueryFilterParameter implements QueryParameter * In order to filter Tasks that don't have any Attachments, set 'without-attachment' to 'true'. * Any other value for 'without-attachment' is invalid. */ + @Schema( + name = "without-attachment", + description = + "In order to filter Tasks that don't have any Attachments, set 'without-attachment' to " + + "'true'. Any other value for 'without-attachment' is invalid.") @JsonProperty("without-attachment") private final Boolean withoutAttachment; // endregion // region callbackState /** Filter by the callback state of the Task. This is an exact match. */ + @Schema( + name = "callback-state", + description = "Filter by the callback state of the Task. This is an exact match.") @JsonProperty("callback-state") private final CallbackState[] callbackStateIn; /** Filter by what the callback state of the Task shouldn't be. This is an exact match. */ + @Schema( + name = "callback-state-not", + description = + "Filter by what the callback state of the Task shouldn't be. This is an exact match.") @JsonProperty("callback-state-not") private final CallbackState[] callbackStateNotIn; // endregion @@ -1158,6 +2528,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This must be used in combination with 'wildcard-search-value' */ + @Schema( + name = "wildcard-search-fields", + description = + "Filter by wildcard search field of the Task.

This must be used in combination with " + + "'wildcard-search-value'") @JsonProperty("wildcard-search-fields") private final WildcardSearchField[] wildcardSearchFieldIn; @@ -1166,6 +2541,11 @@ public class TaskQueryFilterParameter implements QueryParameter * *

This must be used in combination with 'wildcard-search-fields' */ + @Schema( + name = "wildcard-search-value", + description = + "Filter by wildcard search field of the Task. This is an exact match.

This must be" + + " used in combination with 'wildcard-search-fields'") @JsonProperty("wildcard-search-value") private final String wildcardSearchValue; // endregion @@ -2203,7 +3583,7 @@ private String[] addNullToOwnerIn() { return this.ownerIn; } if (this.ownerIn == null) { - return new String[]{null}; + return new String[] {null}; } List ownerInAsList = new ArrayList<>(Arrays.asList(this.ownerIn)); ownerInAsList.add(null); diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryGroupByParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryGroupByParameter.java index 40c21f0217..4ca08f3fa7 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryGroupByParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/TaskQueryGroupByParameter.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Optional; import java.util.function.Consumer; @@ -22,11 +23,25 @@ public void applyGroupByForQuery(TaskQuery query) { } } + public String getGroupBySor() { + return groupBySor; + } + + public TaskQueryGroupBy getGroupByPor() { + return groupByPor; + } + // region groupBy @JsonProperty("group-by") + @Schema( + name = "group-by" + ) private final TaskQueryGroupBy groupByPor; @JsonProperty("group-by-sor") + @Schema( + name = "group-by-sor" + ) private final String groupBySor; // endregion diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/AttachmentSummaryRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/AttachmentSummaryRepresentationModel.java index 2685164ef7..d5685e0374 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/AttachmentSummaryRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/AttachmentSummaryRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.task.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.Instant; import org.springframework.hateoas.RepresentationModel; import pro.taskana.classification.rest.models.ClassificationSummaryRepresentationModel; @@ -10,20 +11,30 @@ public class AttachmentSummaryRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "attachmentId", description = "Unique Id.") protected String attachmentId; /** the referenced task id. */ + @Schema(name = "taskId", description = "The referenced task id.") protected String taskId; /** The creation timestamp in the system. */ + @Schema(name = "created", description = "The creation timestamp in the system.") protected Instant created; /** The timestamp of the last modification. */ + @Schema(name = "modified", description = "The timestamp of the last modification.") protected Instant modified; /** The timestamp of the entry date. */ + @Schema(name = "received", description = "The timestamp of the entry date.") protected Instant received; /** The classification of this attachment. */ + @Schema(name = "classificationSummary", description = "The classification of this attachment.") protected ClassificationSummaryRepresentationModel classificationSummary; /** The Objects primary ObjectReference. */ + @Schema(name = "objectReference", description = "The Objects primary ObjectReference.") protected ObjectReferenceRepresentationModel objectReference; /** Determines on which channel this attachment was received. */ + @Schema( + name = "channel", + description = "Determines on which channel this attachment was received.") protected String channel; public String getAttachmentId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/ObjectReferenceRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/ObjectReferenceRepresentationModel.java index fd2cacd998..be1e689f5a 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/ObjectReferenceRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/ObjectReferenceRepresentationModel.java @@ -1,24 +1,38 @@ package pro.taskana.task.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; public class ObjectReferenceRepresentationModel extends RepresentationModel { /** Unique ID. */ + @Schema(description = "Unique ID.") private String id; /** Task Id. */ + @Schema(description = "Task Id.") private String taskId; /** The company the referenced primary object belongs to. */ + @Schema(description = "The company the referenced primary object belongs to.") private String company; /** The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, ...). */ + @Schema( + description = + "The (kind of) system, the referenced primary object resides in (e.g. SAP, MySystem A, " + + "...).") private String system; /** The instance of the system where the referenced primary object is located. */ + @Schema( + description = "The instance of the system where the referenced primary object is located.") private String systemInstance; /** The type of the referenced primary object (contract, claim, policy, customer, ...). */ + @Schema( + description = + "The type of the referenced primary object (contract, claim, policy, customer, ...).") private String type; /** The value of the primary object reference. */ + @Schema(description = "The value of the primary object reference.") private String value; public String getId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentCollectionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentCollectionRepresentationModel.java index 2dd652d068..b60e5b3fbb 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentCollectionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentCollectionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.CollectionRepresentationModel; @@ -15,6 +16,7 @@ public TaskCommentCollectionRepresentationModel( } /** The embedded task comments. */ + @Schema(name = "taskComments", description = "The embedded task comments.") @JsonProperty("taskComments") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentRepresentationModel.java index 3d57d9d8fa..848b609b71 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskCommentRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.task.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.Instant; import org.springframework.hateoas.RepresentationModel; import pro.taskana.task.api.models.TaskComment; @@ -9,18 +10,25 @@ public class TaskCommentRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "taskCommentId", description = "Unique Id.") private String taskCommentId; /** Task Id. Can identify the task the comment belongs to. */ + @Schema(name = "taskId", description = "Task Id. Can identify the task the comment belongs to.") private String taskId; /** The content of the comment. */ + @Schema(name = "textField", description = "The content of the comment.") private String textField; /** The creator of the task comment. */ + @Schema(name = "creator", description = "The creator of the task comment.") private String creator; /** The long name of the task comment creator. */ + @Schema(name = "creatorFullName", description = "The long name of the task comment creator.") private String creatorFullName; /** The creation timestamp in the system. */ + @Schema(name = "created", description = "The creation timestamp in the system.") private Instant created; /** Timestamp of the last task comment modification. */ + @Schema(name = "modified", description = "Timestamp of the last task comment modification.") private Instant modified; public String getTaskCommentId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskRepresentationModel.java index 4dc3b59356..e3b5accc11 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -13,12 +14,15 @@ public class TaskRepresentationModel extends TaskSummaryRepresentationModel { // All objects have to be serializable /** Additional information of the task. */ + @Schema(name = "customAttributes", description = "Additional information of the task.") private List customAttributes = Collections.emptyList(); /** Callback Information of the task. */ + @Schema(name = "callbackInfo", description = "Callback Information of the task.") private List callbackInfo = Collections.emptyList(); /** Attachments of the task. */ + @Schema(name = "attachments", description = "Attachments of the task.") private List attachments = new ArrayList<>(); public List getCustomAttributes() { @@ -52,8 +56,10 @@ public void setAttachments(List attachments) { public static class CustomAttribute { /** the key of the custom attribute. */ + @Schema(name = "key", description = "the key of the custom attribute.") private String key; /** the value of the custom attribute. */ + @Schema(name = "value", description = "the value of the custom attribute.") private String value; public static CustomAttribute of(Entry entry) { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryCollectionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryCollectionRepresentationModel.java index 6c35975273..f385ae19ec 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryCollectionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryCollectionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.CollectionRepresentationModel; @@ -15,6 +16,7 @@ public TaskSummaryCollectionRepresentationModel( } /** The embedded tasks. */ + @Schema(name = "tasks", description = "The embedded tasks.") @JsonProperty("tasks") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryPagedRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryPagedRepresentationModel.java index 33ff0ee2da..22baff7c86 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryPagedRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryPagedRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.task.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.PageMetadata; @@ -16,6 +17,7 @@ public TaskSummaryPagedRepresentationModel( } /** The embedded tasks. */ + @Schema(name = "tasks", description = "The embedded tasks.") @JsonProperty("tasks") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryRepresentationModel.java index fc879ecc04..56a6c48c1e 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/task/rest/models/TaskSummaryRepresentationModel.java @@ -2,6 +2,7 @@ import static pro.taskana.task.api.models.TaskSummary.DEFAULT_MANUAL_PRIORITY; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import java.time.Instant; import java.util.ArrayList; @@ -15,123 +16,210 @@ public class TaskSummaryRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "taskId", description = "Unique Id.") protected String taskId; /** * External Id. Can be used to enforce idempotence at task creation. Can identify an external * task. */ + @Schema( + name = "externalId", + description = + "External Id. Can be used to enforce idempotence at task creation. Can identify an " + + "external task.") protected String externalId; /** The creation timestamp in the system. */ + @Schema(name = "created", description = "The creation timestamp in the system.") protected Instant created; /** The timestamp of the last claim-operation. */ + @Schema(name = "claimed", description = "The timestamp of the last claim-operation.") protected Instant claimed; /** The timestamp of the completion. */ + @Schema(name = "completed", description = "The timestamp of the completion.") protected Instant completed; /** The timestamp of the last modification. */ + @Schema(name = "modified", description = "The timestamp of the last modification.") protected Instant modified; /** * Planned start of the task. The actual completion of the task should be between PLANNED and DUE. */ + @Schema( + name = "planned", + description = + "Planned start of the task. The actual completion of the task should be between PLANNED" + + " and DUE.") protected Instant planned; /** * Timestamp when the task has been received. It notes when the surrounding process started and * not just when the actual task was created. */ + @Schema( + name = "received", + description = + "Timestamp when the task has been received. It notes when the surrounding process started" + + " and not just when the actual task was created.") protected Instant received; /** * Timestamp when the task is due. The actual completion of the task should be between PLANNED and * DUE. */ + @Schema( + name = "due", + description = + "Timestamp when the task is due. The actual completion of the task should be between " + + "PLANNED and DUE.") protected Instant due; /** The name of the task. */ + @Schema(name = "name", description = "The name of the task.") protected String name; /** the creator of the task. */ + @Schema(name = "creator", description = "the creator of the task.") protected String creator; /** note. */ + @Schema(name = "note", description = "note.") protected String note; /** The description of the task. */ + @Schema(name = "description", description = "The description of the task.") protected String description; /** The priority of the task. */ + @Schema(name = "priority", description = "The priority of the task.") protected int priority; /** * The manual priority of the task. If the value of manualPriority is zero or greater, the * priority is automatically set to manualPriority. In this case, all computations of priority are * disabled. If the value of manualPriority is negative, Tasks are not prioritized manually. */ + @Schema( + name = "manualPriority", + description = + "The manual priority of the task. If the value of manualPriority is zero or greater, the " + + "priority is automatically set to manualPriority. In this case, all computations of" + + " priority are disabled. If the value of manualPriority is negative, Tasks are not" + + " prioritized manually.") protected int manualPriority = DEFAULT_MANUAL_PRIORITY; /** The current task state. */ + @Schema( + name = "state", + description = + "The manual priority of the task. If the value of manualPriority is zero or greater, the " + + "priority is automatically set to manualPriority. In this case, all computations of" + + " priority are disabled. If the value of manualPriority is negative, Tasks are not " + + "prioritized manually.") protected TaskState state; /** The classification of this task. */ - @NotNull protected ClassificationSummaryRepresentationModel classificationSummary; + @Schema(name = "classificationSummary", description = "The classification of this task.") + @NotNull + protected ClassificationSummaryRepresentationModel classificationSummary; /** The workbasket this task resides in. */ - @NotNull protected WorkbasketSummaryRepresentationModel workbasketSummary; + @Schema(name = "workbasketSummary", description = "The workbasket this task resides in.") + @NotNull + protected WorkbasketSummaryRepresentationModel workbasketSummary; /** The business process id. */ + @Schema(name = "businessProcessId", description = "The classification of this task.") protected String businessProcessId; /** the parent business process id. */ + @Schema(name = "parentBusinessProcessId", description = "the parent business process id.") protected String parentBusinessProcessId; /** The owner of the task. The owner is set upon claiming of the task. */ + @Schema( + name = "owner", + description = "The owner of the task. The owner is set upon claiming of the task.") protected String owner; /** The long name of the task owner. */ + @Schema(name = "ownerLongName", description = "The long name of the task owner.") protected String ownerLongName; /** The Objects primary ObjectReference. */ @NotNull protected ObjectReferenceRepresentationModel primaryObjRef; /** Indicator if the task has been read. */ + @Schema(name = "isRead", description = "The Objects primary ObjectReference.") protected boolean isRead; /** Indicator if the task has been transferred. */ + @Schema(name = "isTransferred", description = "Indicator if the task has been transferred.") protected boolean isTransferred; /** Number of Tasks that are grouped together with this Task during a groupBy. */ + @Schema( + name = "groupByCount", + description = "Number of Tasks that are grouped together with this Task during a groupBy.") protected Integer groupByCount; /** A custom property with name "1". */ + @Schema(name = "custom1", description = "A custom property with name \"1\".") protected String custom1; /** A custom property with name "2". */ + @Schema(name = "custom2", description = "A custom property with name \"2\".") protected String custom2; /** A custom property with name "3". */ + @Schema(name = "custom3", description = "A custom property with name \"3\".") protected String custom3; /** A custom property with name "4". */ + @Schema(name = "custom4", description = "A custom property with name \"4\".") protected String custom4; /** A custom property with name "5". */ + @Schema(name = "custom5", description = "A custom property with name \"5\".") protected String custom5; /** A custom property with name "6". */ + @Schema(name = "custom6", description = "A custom property with name \"6\".") protected String custom6; /** A custom property with name "7". */ + @Schema(name = "custom7", description = "A custom property with name \"7\".") protected String custom7; /** A custom property with name "8". */ + @Schema(name = "custom8", description = "A custom property with name \"8\".") protected String custom8; /** A custom property with name "9". */ + @Schema(name = "custom9", description = "A custom property with name \"9\".") protected String custom9; /** A custom property with name "10". */ + @Schema(name = "custom10", description = "A custom property with name \"10\".") protected String custom10; /** A custom property with name "11". */ + @Schema(name = "custom11", description = "A custom property with name \"11\".") protected String custom11; /** A custom property with name "12". */ + @Schema(name = "custom12", description = "A custom property with name \"12\".") protected String custom12; /** A custom property with name "13". */ + @Schema(name = "custom13", description = "A custom property with name \"13\".") protected String custom13; /** A custom property with name "14". */ + @Schema(name = "custom14", description = "A custom property with name \"14\".") protected String custom14; /** A custom property with name "15". */ + @Schema(name = "custom15", description = "A custom property with name \"15\".") protected String custom15; /** A custom property with name "16". */ + @Schema(name = "custom16", description = "A custom property with name \"16\".") protected String custom16; /** A custom int property with name "1". */ + @Schema(name = "customInt1", description = "A custom int property with name \"1\".") protected Integer customInt1; /** A custom int property with name "2". */ + @Schema(name = "customInt2", description = "A custom int property with name \"2\".") protected Integer customInt2; /** A custom int property with name "3". */ + @Schema(name = "customInt3", description = "A custom int property with name \"3\".") protected Integer customInt3; /** A custom int property with name "4". */ + @Schema(name = "customInt4", description = "A custom int property with name \"4\".") protected Integer customInt4; /** A custom int property with name "5". */ + @Schema(name = "customInt5", description = "A custom int property with name \"5\".") protected Integer customInt5; /** A custom int property with name "6". */ + @Schema(name = "customInt6", description = "A custom int property with name \"6\".") protected Integer customInt6; /** A custom int property with name "7". */ + @Schema(name = "customInt7", description = "A custom int property with name \"7\".") protected Integer customInt7; /** A custom int property with name "8". */ + @Schema(name = "customInt8", description = "A custom int property with name \"8\".") protected Integer customInt8; /** Secondary object references of the task. */ + @Schema( + name = "secondaryObjectReferences", + description = "Secondary object references of the task.") protected List secondaryObjectReferences = new ArrayList<>(); /** The attachment summaries of this task. */ + @Schema(name = "attachmentSummaries", description = "The attachment summaries of this task.") private List attachmentSummaries = new ArrayList<>(); public String getTaskId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/UserController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/UserController.java index e380f3c9e0..1ac3d23829 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/UserController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/UserController.java @@ -1,10 +1,17 @@ package pro.taskana.user.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.util.HashSet; import java.util.List; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; import org.springframework.http.HttpStatus; @@ -59,6 +66,24 @@ public class UserController { * @throws UserNotFoundException if the id has not been found * @throws InvalidArgumentException if the id is null or empty */ + @Operation( + summary = "Get a User", + description = "This endpoint retrieves a User.", + parameters = { + @Parameter( + name = "userId", + description = "The ID of the requested user", + example = "teamlead-1") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The requested User", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = UserRepresentationModel.class))) + }) @GetMapping(RestEndpoints.URL_USERS_ID) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getUser(@PathVariable("userId") String userId) @@ -80,6 +105,32 @@ public ResponseEntity getUser(@PathVariable("userId") S * @throws InvalidArgumentException if the userIds are null or empty * @throws UserNotFoundException if the current User was not found */ + @Operation( + summary = "Get multiple Users", + description = + "This endpoint retrieves multiple Users. If a userId can't be found in the database it " + + "will be ignored. If none of the given userIds is valid, the returned list will be" + + " empty. If currentUser is set, the current User from the context will be retrieved" + + " as well.", + parameters = { + @Parameter( + name = "user-id", + description = "The IDs of the users to be retrieved", + example = "teamlead-1"), + @Parameter( + name = "current-user", + description = "Whether to fetch the current user as well", + example = "user-1-1") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "The requested Users", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = UserCollectionRepresentationModel.class))) + }) @GetMapping(RestEndpoints.URL_USERS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getUsers( @@ -111,6 +162,36 @@ public ResponseEntity getUsers( * @throws UserAlreadyExistException if a User with id } is already existing * @throws NotAuthorizedException if the current user is no admin or business-admin */ + @Operation( + summary = "Create a User", + description = "This endpoint creates a new User.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the User which should be created", + required = true, + content = + @Content( + schema = @Schema(implementation = UserRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"userId\": \"user-10-2\",\n" + + " \"groups\": [],\n" + + " \"permissions\": [],\n" + + " \"domains\": [],\n" + + " \"firstName\": \"Hans\",\n" + + " \"lastName\": \"Georg\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "201", + description = "The inserted User", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = UserRepresentationModel.class))) + }) @PostMapping(RestEndpoints.URL_USERS) @Transactional(rollbackFor = Exception.class) public ResponseEntity createUser( @@ -133,6 +214,53 @@ public ResponseEntity createUser( * @throws UserNotFoundException if a User with id is not existing in the database * @throws NotAuthorizedException if the current user is no admin or business-admin */ + @Operation( + summary = "Update a User", + description = "This endpoint updates a User.", + parameters = { + @Parameter( + name = "userId", + description = "The ID of the User to update", + example = "teamlead-1") + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the User with the updated fields", + required = true, + content = + @Content( + schema = @Schema(implementation = UserRepresentationModel.class), + examples = { + @ExampleObject( + value = + "{\n" + + " \"userId\": \"teamlead-1\",\n" + + " \"groups\": [],\n" + + " \"permissions\": [],\n" + + " \"domains\": [\"DOMAIN_A\"],\n" + + " \"firstName\": \"new name\",\n" + + " \"lastName\": \"Toll\",\n" + + " \"fullName\": \"Toll, Titus\",\n" + + " \"longName\": \"Toll, Titus - (teamlead-1)\",\n" + + " \"email\": \"titus.toll@web.de\",\n" + + " \"phone\": \"040-2951854\",\n" + + " \"mobilePhone\": \"015637683197\",\n" + + " \"orgLevel4\": \"Novatec\",\n" + + " \"orgLevel3\": \"BPM\",\n" + + " \"orgLevel2\": \"Human Workflow\",\n" + + " \"orgLevel1\": \"TASKANA\",\n" + + " \"data\": \"xy\"\n" + + "}") + })), + responses = { + @ApiResponse( + responseCode = "200", + description = "The updated User", + content = + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = UserRepresentationModel.class))) + }) @PutMapping(RestEndpoints.URL_USERS_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity updateUser( @@ -161,6 +289,21 @@ public ResponseEntity updateUser( * @throws NotAuthorizedException if the current user is no admin or business-admin * @throws InvalidArgumentException if the id is null or empty */ + @Operation( + summary = "Delete a User", + description = "This endpoint deletes a User.", + parameters = { + @Parameter( + name = "userId", + description = "The ID of the user to delete", + example = "user-1-1") + }, + responses = { + @ApiResponse( + responseCode = "204", + description = "User deleted", + content = @Content(schema = @Schema())) + }) @DeleteMapping(RestEndpoints.URL_USERS_ID) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity deleteUser(@PathVariable("userId") String userId) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserCollectionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserCollectionRepresentationModel.java index 1536e45744..7f0c32b16b 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserCollectionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserCollectionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.user.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.CollectionRepresentationModel; @@ -13,6 +14,7 @@ public UserCollectionRepresentationModel(Collection con } /** The embedded users. */ + @Schema(name = "users", description = "The embedded users.") @JsonProperty("users") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserRepresentationModel.java index f951550a8f..419eb650bd 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/user/rest/models/UserRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.user.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import java.util.Collections; import java.util.Objects; @@ -11,10 +12,13 @@ public class UserRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "userId", description = "Unique Id.") @NotNull private String userId; /** The groups of the User. */ + @Schema(name = "groups", description = "The groups of the User.") private Set groups; /** The permissions of the User. */ + @Schema(name = "permissions", description = "The permissions of the User.") private Set permissions; /** * The domains of the User. @@ -24,28 +28,43 @@ public class UserRepresentationModel extends RepresentationModel domains = Collections.emptySet(); /** The first name of the User. */ + @Schema(name = "firstName", description = "The first name of the User.") private String firstName; /** The last name of the User. */ + @Schema(name = "lastName", description = "The last name of the User.") private String lastName; /** The full name of the User. */ + @Schema(name = "fullName", description = "The full name of the User.") private String fullName; /** The long name of the User. */ + @Schema(name = "longName", description = "The long name of the User.") private String longName; /** The email of the User. */ + @Schema(name = "email", description = "The email of the User.") private String email; /** The phone number of the User. */ + @Schema(name = "phone", description = "The phone number of the User.") private String phone; /** The mobile phone number of the User. */ + @Schema(name = "mobilePhone", description = "The mobile phone number of the User.") private String mobilePhone; /** The fourth organisation level of the User. */ + @Schema(name = "orgLevel4", description = "The fourth organisation level of the User.") private String orgLevel4; /** The third organisation level of the User. */ + @Schema(name = "orgLevel3", description = "The third organisation level of the User.") private String orgLevel3; /** The second organisation level of the User. */ + @Schema(name = "orgLevel2", description = "The second organisation level of the User.") private String orgLevel2; /** The first organisation level of the User. */ + @Schema(name = "orgLevel1", description = "The first organisation level of the User.") private String orgLevel1; /** The data of the User. This field is used for additional information about the User. */ + @Schema( + name = "data", + description = + "The data of the User. This field is used for additional information about the User.") private String data; public String getUserId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemController.java index a46f87ac07..723a5c04e6 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemController.java @@ -1,10 +1,17 @@ package pro.taskana.workbasket.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.beans.ConstructorProperties; import java.util.List; import java.util.function.BiConsumer; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; @@ -56,12 +63,35 @@ public WorkbasketAccessItemController( * @return the Workbasket Access Items with the given filter, sort and paging options. * @throws NotAuthorizedException if the user is not authorized. */ + @Operation( + summary = "Get a list of all Workbasket Access Items", + description = + "This endpoint retrieves a list of existing Workbasket Access Items. Filters can be " + + "applied.", + parameters = { + @Parameter(name = "sort-by", example = "WORKBASKET_KEY"), + @Parameter(name = "order", example = "ASCENDING"), + @Parameter(name = "access-id", example = "user-2-2") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = + "the Workbasket Access Items with the given filter, sort and paging options.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = WorkbasketAccessItemPagedRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_WORKBASKET_ACCESS_ITEMS) public ResponseEntity getWorkbasketAccessItems( HttpServletRequest request, - WorkbasketAccessItemQueryFilterParameter filterParameter, - WorkbasketAccessItemQuerySortParameter sortParameter, - QueryPagingParameter pagingParameter) + @ParameterObject WorkbasketAccessItemQueryFilterParameter filterParameter, + @ParameterObject WorkbasketAccessItemQuerySortParameter sortParameter, + @ParameterObject + QueryPagingParameter pagingParameter) throws NotAuthorizedException { QueryParamsValidator.validateParams( @@ -91,6 +121,21 @@ public ResponseEntity getWorkbaske * @throws NotAuthorizedException if the user is not authorized. * @throws InvalidArgumentException if some argument is invalid. */ + @Operation( + summary = "Delete a Workbasket Access Item", + description = "This endpoint deletes all Workbasket Access Items for a provided Access Id.", + parameters = { + @Parameter( + name = "accessId", + description = "the Access Id whose Workbasket Access Items should be removed", + example = "user-2-1", + required = true) + }, + responses = { + @ApiResponse( + responseCode = "204", + content = {@Content(schema = @Schema())}) + }) @DeleteMapping(path = RestEndpoints.URL_WORKBASKET_ACCESS_ITEMS) public ResponseEntity removeWorkbasketAccessItems( @RequestParam("access-id") String accessId) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemQueryFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemQueryFilterParameter.java index de230fc70f..c7e4d2d5a6 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemQueryFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketAccessItemQueryFilterParameter.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Optional; import pro.taskana.common.rest.QueryParameter; @@ -8,8 +9,26 @@ public class WorkbasketAccessItemQueryFilterParameter implements QueryParameter { + public String[] getWorkbasketKey() { + return workbasketKey; + } + + public String[] getWorkbasketKeyLike() { + return workbasketKeyLike; + } + + public String[] getAccessId() { + return accessId; + } + + public String[] getAccessIdLike() { + return accessIdLike; + } /** Filter by the key of the Workbasket. This is an exact match. */ + @Schema( + name = "workbasket-key", + description = "Filter by the key of the Workbasket. This is an exact match.") @JsonProperty("workbasket-key") private final String[] workbasketKey; @@ -18,10 +37,19 @@ public class WorkbasketAccessItemQueryFilterParameter * beginning and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "workbasket-key-like", + description = + "Filter by the key of the Workbasket. This results in a substring search.. (% is appended" + + " to the beginning and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("workbasket-key-like") private final String[] workbasketKeyLike; /** Filter by the name of the access id. This is an exact match. */ + @Schema( + name = "access-id", + description = "Filter by the name of the access id. This is an exact match.") @JsonProperty("access-id") private final String[] accessId; @@ -30,6 +58,12 @@ public class WorkbasketAccessItemQueryFilterParameter * beginning and end of the requested value). Further SQL "LIKE" wildcard characters will be * resolved correctly. */ + @Schema( + name = "access-id-like", + description = + "Filter by the name of the access id. This results in a substring search.. (% is appended" + + " to the beginning and end of the requested value). Further SQL \"LIKE\" wildcard " + + "characters will be resolved correctly.") @JsonProperty("access-id-like") private final String[] accessIdLike; diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketController.java index dd4a9d09ef..82239aad30 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketController.java @@ -1,11 +1,19 @@ package pro.taskana.workbasket.rest; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.servlet.http.HttpServletRequest; import java.beans.ConstructorProperties; import java.util.List; import java.util.function.BiConsumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springdoc.core.annotations.ParameterObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; @@ -89,13 +97,29 @@ public class WorkbasketController { * @param pagingParameter the paging parameters * @return the Workbaskets with the given filter, sort and paging options. */ + @Operation( + summary = "Get a list of all Workbaskets", + description = + "This endpoint retrieves a list of existing Workbaskets. Filters can be applied.", + parameters = {@Parameter(name = "type", example = "PERSONAL")}, + responses = { + @ApiResponse( + responseCode = "200", + description = "Found all Workbaskets", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema(implementation = WorkbasketSummaryPagedRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_WORKBASKET) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getWorkbaskets( HttpServletRequest request, - WorkbasketQueryFilterParameter filterParameter, - WorkbasketQuerySortParameter sortParameter, - QueryPagingParameter pagingParameter) { + @ParameterObject WorkbasketQueryFilterParameter filterParameter, + @ParameterObject WorkbasketQuerySortParameter sortParameter, + @ParameterObject QueryPagingParameter pagingParameter) { QueryParamsValidator.validateParams( request, @@ -125,6 +149,26 @@ public ResponseEntity getWorkbaskets( * @throws NotAuthorizedOnWorkbasketException if the current user has no permissions to access the * requested Workbasket */ + @Operation( + summary = "Get a single Workbasket", + description = "This endpoint retrieves a single Workbasket.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the requested Workbasket", + required = true, + example = "WBI:100000000000000000000000000000000001") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the requested Workbasket", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = WorkbasketRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_WORKBASKET_ID, produces = MediaTypes.HAL_JSON_VALUE) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getWorkbasket( @@ -157,6 +201,35 @@ public ResponseEntity getWorkbasket( * @throws WorkbasketInUseException if the Workbasket contains tasks. * @throws NotAuthorizedException if the current user has not correct permissions */ + @Operation( + summary = "Delete a Workbasket", + description = "This endpoint deletes an existing Workbasket", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the requested Workbasket", + required = true, + example = "WBI:100000000000000000000000000000000002") + }, + responses = { + @ApiResponse( + responseCode = "204", + description = "204 NO_CONTENT - Workbasket has been deleted successfully", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "202", + description = + "202 ACCEPTED - Workbasket still contains completed Tasks. It has been " + + "marked for deletion and will be deleted automatically as soon as all " + + "completed Tasks are deleted.", + content = @Content(schema = @Schema())), + @ApiResponse( + responseCode = "423", + description = + "423 LOCKED - Workbasket contains non-completed Tasks and cannot be " + + "deleted.", + content = @Content(schema = @Schema())) + }) @DeleteMapping(path = RestEndpoints.URL_WORKBASKET_ID) @Transactional(rollbackFor = Exception.class, noRollbackFor = WorkbasketNotFoundException.class) public ResponseEntity deleteWorkbasket( @@ -195,6 +268,35 @@ public ResponseEntity deleteWorkbasket( * @throws WorkbasketAlreadyExistException if the Workbasket exists already * @throws DomainNotFoundException if the domain does not exist in the configuration. */ + @Operation( + summary = "Create a new Workbasket", + description = "This endpoint creates a persistent Workbasket.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the Workbasket which should be created.", + content = + @Content( + schema = @Schema(implementation = WorkbasketRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"key\" : \"asdasdasd\",\n" + + " \"name\" : \"this is a wonderful workbasket name\",\n" + + " \"domain\" : \"DOMAIN_A\",\n" + + " \"type\" : \"GROUP\",\n" + + " \"markedForDeletion\" : false\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "201", + description = "the created Workbasket", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = WorkbasketRepresentationModel.class)) + }) + }) @PostMapping(path = RestEndpoints.URL_WORKBASKET) @Transactional(rollbackFor = Exception.class) public ResponseEntity createWorkbasket( @@ -226,6 +328,60 @@ public ResponseEntity createWorkbasket( * updated it already * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ + @Operation( + summary = "Update a Workbasket", + description = "This endpoint creates a persistent Workbasket.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the requested Workbasket", + required = true, + example = "WBI:100000000000000000000000000000000001") + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the new Workbasket for the requested id", + content = + @Content( + schema = @Schema(implementation = WorkbasketRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"workbasketId\" : " + + "\"WBI:100000000000000000000000000000000001\",\n" + + " \"key\" : \"GPK_KSC\",\n" + + " \"name\" : \"new name\",\n" + + " \"domain\" : \"DOMAIN_A\",\n" + + " \"type\" : \"GROUP\",\n" + + " \"description\" : \"Gruppenpostkorb KSC\",\n" + + " \"owner\" : \"teamlead-1\",\n" + + " \"custom1\" : \"ABCQVW\",\n" + + " \"custom2\" : \"\",\n" + + " \"custom3\" : \"xyz4\",\n" + + " \"custom4\" : \"\",\n" + + " \"custom5\" : \"\",\n" + + " \"custom6\" : \"\",\n" + + " \"custom7\" : \"\",\n" + + " \"custom8\" : \"\",\n" + + " \"orgLevel1\" : \"\",\n" + + " \"orgLevel2\" : \"\",\n" + + " \"orgLevel3\" : \"\",\n" + + " \"orgLevel4\" : \"\",\n" + + " \"markedForDeletion\" : false,\n" + + " \"created\" : \"2018-02-01T12:00:00.000Z\",\n" + + " \"modified\" : \"2018-02-01T12:00:00.000Z\"\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the requested Workbasket", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = @Schema(implementation = WorkbasketRepresentationModel.class)) + }) + }) @PutMapping(path = RestEndpoints.URL_WORKBASKET_ID) @Transactional(rollbackFor = Exception.class) public ResponseEntity updateWorkbasket( @@ -262,6 +418,28 @@ public ResponseEntity updateWorkbasket( * @throws WorkbasketNotFoundException if the requested Workbasket does not exist. * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ + @Operation( + summary = "Get all Workbasket Access Items", + description = "This endpoint retrieves all Workbasket Access Items for a given Workbasket.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the requested Workbasket", + required = true, + example = "WBI:100000000000000000000000000000000001") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the access items for the requested Workbasket.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = WorkbasketAccessItemCollectionRepresentationModel.class)) + }) + }) @GetMapping( path = RestEndpoints.URL_WORKBASKET_ID_ACCESS_ITEMS, produces = MediaTypes.HAL_JSON_VALUE) @@ -295,6 +473,69 @@ public ResponseEntity getWork * in the provided list. * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ + @Operation( + summary = "Set all Workbasket Access Items", + description = + "This endpoint replaces all Workbasket Access Items for a given Workbasket with the " + + "provided", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the Workbasket whose Workbasket Access Items will be replaced", + required = true, + example = "WBI:100000000000000000000000000000000001") + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the new Workbasket Access Items.", + content = + @Content( + schema = + @Schema( + implementation = + WorkbasketAccessItemCollectionRepresentationModel.class), + examples = + @ExampleObject( + value = + "{\n" + + " \"accessItems\" : [ {\n" + + " \"workbasketId\" : " + + "\"WBI:100000000000000000000000000000000001\",\n" + + " \"accessId\" : \"new-access-id\",\n" + + " \"accessName\" : \"new-access-name\",\n" + + " \"permRead\" : false,\n" + + " \"permReadTasks\" : false,\n" + + " \"permOpen\" : true,\n" + + " \"permAppend\" : false,\n" + + " \"permEditTasks\" : false,\n" + + " \"permTransfer\" : false,\n" + + " \"permDistribute\" : false,\n" + + " \"permCustom1\" : false,\n" + + " \"permCustom2\" : false,\n" + + " \"permCustom3\" : false,\n" + + " \"permCustom4\" : false,\n" + + " \"permCustom5\" : false,\n" + + " \"permCustom6\" : false,\n" + + " \"permCustom7\" : false,\n" + + " \"permCustom8\" : false,\n" + + " \"permCustom9\" : false,\n" + + " \"permCustom10\" : false,\n" + + " \"permCustom11\" : false,\n" + + " \"permCustom12\" : false\n" + + " } ]\n" + + "}"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the new Workbasket Access Items for the requested Workbasket", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = WorkbasketAccessItemCollectionRepresentationModel.class)) + }) + }) @PutMapping(path = RestEndpoints.URL_WORKBASKET_ID_ACCESS_ITEMS) @Transactional(rollbackFor = Exception.class) public ResponseEntity setWorkbasketAccessItems( @@ -332,6 +573,28 @@ public ResponseEntity setWork * @throws NotAuthorizedOnWorkbasketException if the current user has no read permission for the * specified Workbasket */ + @Operation( + summary = "Get all Distribution Targets for a Workbasket", + description = "This endpoint retrieves all Distribution Targets for a requested Workbasket.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the Workbasket whose Distribution Targets will be retrieved", + required = true, + example = "WBI:100000000000000000000000000000000002") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "the Distribution Targets for the requested Workbasket", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = DistributionTargetsCollectionRepresentationModel.class)) + }) + }) @GetMapping( path = RestEndpoints.URL_WORKBASKET_ID_DISTRIBUTION, produces = MediaTypes.HAL_JSON_VALUE) @@ -359,6 +622,41 @@ public ResponseEntity getDistr * the source Workbasket * @throws NotAuthorizedException if the current user has not correct permissions */ + @Operation( + summary = "Set all Distribution Targets for a Workbasket", + description = + "This endpoint replaces all Distribution Targets for a given Workbasket with the " + + "provided ones.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the source Workbasket", + required = true, + example = "WBI:100000000000000000000000000000000001") + }, + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "the destination Workbaskets.", + content = + @Content( + array = @ArraySchema(schema = @Schema(implementation = String.class)), + examples = + @ExampleObject( + value = + "[ \"WBI:100000000000000000000000000000000002\", " + + "\"WBI:100000000000000000000000000000000003\" ]"))), + responses = { + @ApiResponse( + responseCode = "200", + description = "the new Distribution Targets for the requested Workbasket.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = DistributionTargetsCollectionRepresentationModel.class)) + }) + }) @PutMapping(path = RestEndpoints.URL_WORKBASKET_ID_DISTRIBUTION) @Transactional(rollbackFor = Exception.class) public ResponseEntity @@ -388,6 +686,17 @@ public ResponseEntity getDistr * @throws NotAuthorizedException if the requested user ist not ADMIN or BUSINESS_ADMIN. * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ + @Operation( + summary = "Remove a Workbasket as Distribution Target", + description = + "This endpoint removes all Distribution Target references for a provided Workbasket.", + parameters = { + @Parameter( + name = "workbasketId", + description = "the Id of the requested Workbasket.", + required = true, + example = "WBI:100000000000000000000000000000000007") + }) @DeleteMapping(path = RestEndpoints.URL_WORKBASKET_ID_DISTRIBUTION) @Transactional(rollbackFor = Exception.class) public ResponseEntity removeDistributionTargetForWorkbasketId( diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketDefinitionController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketDefinitionController.java index 0304201de2..0e0e45dea4 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketDefinitionController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketDefinitionController.java @@ -4,6 +4,11 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -15,7 +20,9 @@ import java.util.Set; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.config.EnableHypermediaSupport; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; @@ -79,6 +86,26 @@ public class WorkbasketDefinitionController { * @param domain Filter the export for a specific domain. * @return all workbaskets. */ + @Operation( + summary = "Export Workbaskets", + description = + "This endpoint exports all Workbaskets with the corresponding Workbasket Access Items " + + "and Distribution Targets. We call this data structure Workbasket Definition.", + parameters = { + @Parameter(name = "domain", description = "Filter the export for a specific domain.") + }, + responses = { + @ApiResponse( + responseCode = "200", + description = "all workbaskets.", + content = { + @Content( + mediaType = MediaTypes.HAL_JSON_VALUE, + schema = + @Schema( + implementation = WorkbasketDefinitionCollectionRepresentationModel.class)) + }) + }) @GetMapping(path = RestEndpoints.URL_WORKBASKET_DEFINITIONS) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity exportWorkbaskets( @@ -123,7 +150,30 @@ public ResponseEntity exportW * @throws ConcurrencyException if Workbasket was updated by an other user * @throws NotAuthorizedOnWorkbasketException if the current user has not correct permissions */ - @PostMapping(path = RestEndpoints.URL_WORKBASKET_DEFINITIONS) + @Operation( + summary = "Import Workbaskets", + description = + "This endpoint imports a list of Workbasket Definitions.

This does not exactly match " + + "the REST norm, but we want to have an option to import all settings at once. When" + + " a logical equal (key and domain are equal) Workbasket already exists an update " + + "will be executed. Otherwise a new Workbasket will be created.", + requestBody = + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = + "the list of Workbasket Definitions which will be imported to the current system." + + " To get an example file containing Workbasket Definitions, go to the " + + "[TASKANA UI](http://localhost:8080/taskana/index.html) and export the" + + "Workbaskets", + required = true, + content = @Content(mediaType = MediaType.MULTIPART_FORM_DATA_VALUE)), + responses = { + @ApiResponse( + responseCode = "204", + content = {@Content(schema = @Schema())}) + }) + @PostMapping( + path = RestEndpoints.URL_WORKBASKET_DEFINITIONS, + consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @Transactional(rollbackFor = Exception.class) public ResponseEntity importWorkbaskets(@RequestParam("file") MultipartFile file) throws IOException, diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketQueryFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketQueryFilterParameter.java index df65d82158..3d0743dc71 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketQueryFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/WorkbasketQueryFilterParameter.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Optional; import pro.taskana.common.rest.QueryParameter; @@ -11,6 +12,9 @@ public class WorkbasketQueryFilterParameter implements QueryParameter { /** Filter by the name of the Workbasket. This is an exact match. */ + @Schema( + name = "name", + description = "Filter by the name of the Workbasket. This is an exact match.") @JsonProperty("name") private final String[] name; @@ -19,10 +23,19 @@ public class WorkbasketQueryFilterParameter implements QueryParameter getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemCollectionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemCollectionRepresentationModel.java index 8fd64ec8be..7945a8e711 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemCollectionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemCollectionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.CollectionRepresentationModel; @@ -16,6 +17,7 @@ public WorkbasketAccessItemCollectionRepresentationModel( /** the embedded access items. */ @JsonProperty("accessItems") + @Schema(name = "accessItems", description = "the embedded access items.") @Override public Collection getContent() { return super.getContent(); diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemPagedRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemPagedRepresentationModel.java index afa8f0ad26..593418884f 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemPagedRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemPagedRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.PageMetadata; @@ -16,6 +17,7 @@ public WorkbasketAccessItemPagedRepresentationModel( } /** the embedded access items. */ + @Schema(name = "accessItems", description = "the embedded access items.") @JsonProperty("accessItems") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemRepresentationModel.java index 97e75cd2b0..1cdb88e71c 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketAccessItemRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.workbasket.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import pro.taskana.workbasket.api.models.WorkbasketAccessItem; @@ -8,54 +9,96 @@ public class WorkbasketAccessItemRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "accessItemId", description = "Unique Id.") private String accessItemId; /** The workbasket Id. */ + @Schema(name = "workbasketId", description = "The workbasket Id.") private String workbasketId; /** The Access Id. This could be either a user Id or a full qualified group Id. */ + @Schema( + name = "accessId", + description = "The Access Id. This could be either a user Id or a full qualified group Id.") private String accessId; /** The workbasket key. */ + @Schema(name = "workbasketKey", description = "The workbasket key.") private String workbasketKey; /** The name. */ + @Schema(name = "accessName", description = "The name.") private String accessName; /** The permission to read the information about the workbasket. */ + @Schema( + name = "permRead", + description = "The permission to read the information about the workbasket.") private boolean permRead; /** The permission to access a task from the workbasket. */ + @Schema( + name = "permReadTasks", + description = "The permission to access a task from the workbasket.") private boolean permReadTasks; /** The permission to view the content (the tasks) of a workbasket. */ + @Schema( + name = "permOpen", + description = "The permission to view the content (the tasks) of a workbasket.") private boolean permOpen; /** * The permission to add tasks to the workbasket. Required for creation and transferring of tasks. */ + @Schema( + name = "permAppend", + description = + "The permission to add tasks to the workbasket. Required for creation and transferring " + + "of tasks.") private boolean permAppend; /** The permission to edit a task from the workbasket. */ + @Schema( + name = "permEditTasks", + description = "The permission to edit a task from the workbasket.") private boolean permEditTasks; /** The permission to transfer tasks (out of the current workbasket). */ + @Schema( + name = "permTransfer", + description = "The permission to transfer tasks (out of the current workbasket).") private boolean permTransfer; /** The permission to distribute tasks from the workbasket. */ + @Schema( + name = "permDistribute", + description = "The permission to distribute tasks from the workbasket.") private boolean permDistribute; /** The custom permission with the name "1". */ + @Schema(name = "permCustom1", description = "The custom permission with the name '1'.") private boolean permCustom1; /** The custom permission with the name "2". */ + @Schema(name = "permCustom2", description = "The custom permission with the name '2'.") private boolean permCustom2; /** The custom permission with the name "3". */ + @Schema(name = "permCustom3", description = "The custom permission with the name '3'.") private boolean permCustom3; /** The custom permission with the name "4". */ + @Schema(name = "permCustom4", description = "The custom permission with the name '4'.") private boolean permCustom4; /** The custom permission with the name "5". */ + @Schema(name = "permCustom5", description = "The custom permission with the name '5'.") private boolean permCustom5; /** The custom permission with the name "6". */ + @Schema(name = "permCustom6", description = "The custom permission with the name '6'.") private boolean permCustom6; /** The custom permission with the name "7". */ + @Schema(name = "permCustom7", description = "The custom permission with the name '7'.") private boolean permCustom7; /** The custom permission with the name "8". */ + @Schema(name = "permCustom8", description = "The custom permission with the name '8'.") private boolean permCustom8; /** The custom permission with the name "9". */ + @Schema(name = "permCustom9", description = "The custom permission with the name '9'.") private boolean permCustom9; /** The custom permission with the name "10". */ + @Schema(name = "permCustom10", description = "The custom permission with the name '10'.") private boolean permCustom10; /** The custom permission with the name "11". */ + @Schema(name = "permCustom11", description = "The custom permission with the name '11'.") private boolean permCustom11; /** The custom permission with the name "12". */ + @Schema(name = "permCustom12", description = "The custom permission with the name '12'.") private boolean permCustom12; public String getAccessItemId() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionCollectionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionCollectionRepresentationModel.java index 99317be15a..66740b5f51 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionCollectionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionCollectionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.CollectionRepresentationModel; @@ -15,6 +16,7 @@ public WorkbasketDefinitionCollectionRepresentationModel( } /** the embedded workbasket definitions. */ + @Schema(name = "workbasketDefinitions", description = "the embedded workbasket definitions.") @JsonProperty("workbasketDefinitions") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionRepresentationModel.java index db39531343..60549c381a 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketDefinitionRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -12,11 +13,16 @@ public class WorkbasketDefinitionRepresentationModel extends RepresentationModel { /** The workbasket which is represented. */ + @Schema(name = "workbasket", description = "The workbasket which is represented.") @JsonIgnoreProperties("_links") private WorkbasketRepresentationModel workbasket; /** The workbasket authorizations. */ + @Schema(name = "authorizations", description = "The workbasket authorizations.") private Collection authorizations = new ArrayList<>(); /** The distribution targets for this workbasket. */ + @Schema( + name = "distributionTargets", + description = "The distribution targets for this workbasket.") private Set distributionTargets = new HashSet<>(); public Set getDistributionTargets() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketRepresentationModel.java index a3319ca5a9..64903f380c 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.workbasket.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.Instant; import pro.taskana.workbasket.api.models.Workbasket; @@ -11,12 +12,21 @@ public class WorkbasketRepresentationModel extends WorkbasketSummaryRepresentati * *

The format is ISO-8601. */ + @Schema( + name = "created", + description = + "The creation timestamp of the workbasket in the system. The format is ISO-8601.") private Instant created; + /** * The timestamp of the last modification. * *

The format is ISO-8601. */ + @Schema( + name = "modified", + description = + "The timestamp of the last modification. The format is ISO-8601.") private Instant modified; public Instant getCreated() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryPagedRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryPagedRepresentationModel.java index a7f075d84d..29d5edb89e 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryPagedRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryPagedRepresentationModel.java @@ -1,6 +1,7 @@ package pro.taskana.workbasket.rest.models; import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; import java.beans.ConstructorProperties; import java.util.Collection; import pro.taskana.common.rest.models.PageMetadata; @@ -16,6 +17,7 @@ public WorkbasketSummaryPagedRepresentationModel( } /** the embedded workbaskets. */ + @Schema(name = "workbaskets", description = "the embedded workbaskets.") @JsonProperty("workbaskets") @Override public Collection getContent() { diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryRepresentationModel.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryRepresentationModel.java index edd24e4f71..b2d0843083 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryRepresentationModel.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/workbasket/rest/models/WorkbasketSummaryRepresentationModel.java @@ -1,5 +1,6 @@ package pro.taskana.workbasket.rest.models; +import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.hateoas.RepresentationModel; import pro.taskana.workbasket.api.WorkbasketType; import pro.taskana.workbasket.api.models.WorkbasketSummary; @@ -9,38 +10,72 @@ public class WorkbasketSummaryRepresentationModel extends RepresentationModel { /** Unique Id. */ + @Schema(name = "workbasketId", description = "Unique Id.") protected String workbasketId; + /** the professional key for the workbasket. */ + @Schema(name = "key", description = "the professional key for the workbasket.") protected String key; + /** The name of the workbasket. */ + @Schema(name = "name", description = "The name of the workbasket.") protected String name; + /** The domain the workbasket belongs to. */ + @Schema(name = "domain", description = "The domain the workbasket belongs to.") protected String domain; + /** The type of the workbasket. */ + @Schema(name = "type", description = "The type of the workbasket.") protected WorkbasketType type; + /** the description of the workbasket. */ + @Schema(name = "description", description = "the description of the workbasket.") protected String description; + /** * The owner of the workbasket. The owner is responsible for the on-time completion of all tasks * in the workbasket. */ + @Schema( + name = "owner", + description = + "The owner of the workbasket. The owner is responsible for the on-time completion of " + + "all tasks in the workbasket.") protected String owner; + /** A custom property with name "1". */ + @Schema(name = "custom1", description = "A custom property with name \"1\".") protected String custom1; + /** A custom property with name "2". */ + @Schema(name = "custom2", description = "A custom property with name \"2\".") protected String custom2; + /** A custom property with name "3". */ + @Schema(name = "custom3", description = "A custom property with name \"3\".") protected String custom3; + /** A custom property with name "4". */ + @Schema(name = "custom4", description = "A custom property with name \"4\".") protected String custom4; + /** A custom property with name "5". */ + @Schema(name = "custom5", description = "A custom property with name \"5\".") protected String custom5; + /** A custom property with name "6". */ + @Schema(name = "custom6", description = "A custom property with name \"6\".") protected String custom6; + /** A custom property with name "7". */ + @Schema(name = "custom7", description = "A custom property with name \"7\".") protected String custom7; + /** A custom property with name "8". */ + @Schema(name = "custom8", description = "A custom property with name \"8\".") protected String custom8; + /** * The first Org Level (the top one). * @@ -48,13 +83,27 @@ public class WorkbasketSummaryRepresentationModel * are used for monitoring and statistical purposes and should reflect who is responsible of the * tasks in the workbasket. */ + @Schema( + name = "orgLevel1", + description = + "The first Org Level (the top one).

The Org Level is an association with an org " + + "hierarchy level in the organization. The values are used for monitoring and " + + "statistical purposes and should reflect who is responsible of the tasks in the" + + " workbasket.") protected String orgLevel1; + /** The second Org Level. */ + @Schema(name = "orgLevel2", description = "The second Org Level.") protected String orgLevel2; + /** The third Org Level. */ + @Schema(name = "orgLevel3", description = "The third Org Level.") protected String orgLevel3; + /** The fourth Org Level (the lowest one). */ + @Schema(name = "orgLevel4", description = "The fourth Org Level.") protected String orgLevel4; + /** Identifier to tell if this workbasket can be deleted. */ private boolean markedForDeletion;