diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/RestEndpoints.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/RestEndpoints.java index 19bb77621..0afaa753c 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/RestEndpoints.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/common/rest/RestEndpoints.java @@ -5,29 +5,39 @@ public final class RestEndpoints { public static final String API_V1 = "/api/v1/"; + // configuration endpoints public static final String URL_VERSION = API_V1 + "version"; public static final String URL_DOMAIN = API_V1 + "domains"; public static final String URL_CURRENT_USER = API_V1 + "current-user-info"; - public static final String URL_ACCESS_ID = API_V1 + "access-ids"; - public static final String URL_ACCESS_ID_GROUPS = API_V1 + "access-ids/groups"; - - public static final String URL_CLASSIFICATIONS = API_V1 + "classifications"; - public static final String URL_CLASSIFICATIONS_ID = API_V1 + "classifications/{classificationId}"; - public static final String URL_CLASSIFICATION_DEFINITIONS = API_V1 + "classification-definitions"; public static final String URL_CLASSIFICATION_CATEGORIES = API_V1 + "classification-categories"; public static final String URL_CLASSIFICATION_TYPES = API_V1 + "classification-types"; public static final String URL_CLASSIFICATION_CATEGORIES_BY_TYPES = API_V1 + "classifications-by-type"; - public static final String URL_WORKBASKET_ACCESS_ITEMS = API_V1 + "workbasket-access-items"; - public static final String URL_WORKBASKET = API_V1 + "workbaskets"; + // access id endpoints + public static final String URL_ACCESS_ID = API_V1 + "access-ids"; + public static final String URL_ACCESS_ID_GROUPS = API_V1 + "access-ids/groups"; + + // import / export endpoints + public static final String URL_CLASSIFICATION_DEFINITIONS = API_V1 + "classification-definitions"; public static final String URL_WORKBASKET_DEFINITIONS = API_V1 + "workbasket-definitions"; + + // classification endpoints + public static final String URL_CLASSIFICATIONS = API_V1 + "classifications"; + public static final String URL_CLASSIFICATIONS_ID = API_V1 + "classifications/{classificationId}"; + + // workbasket endpoints + public static final String URL_WORKBASKET = API_V1 + "workbaskets"; public static final String URL_WORKBASKET_ID = API_V1 + "workbaskets/{workbasketId}"; public static final String URL_WORKBASKET_ID_ACCESS_ITEMS = API_V1 + "workbaskets/{workbasketId}/workbasketAccessItems"; public static final String URL_WORKBASKET_ID_DISTRIBUTION = API_V1 + "workbaskets/{workbasketId}/distribution-targets"; + // access item endpoints + public static final String URL_WORKBASKET_ACCESS_ITEMS = API_V1 + "workbasket-access-items"; + + // task endpoints public static final String URL_TASKS = API_V1 + "tasks"; public static final String URL_TASKS_ID = API_V1 + "tasks/{taskId}"; public static final String URL_TASKS_ID_CLAIM = API_V1 + "tasks/{taskId}/claim"; @@ -36,18 +46,20 @@ public final class RestEndpoints { public static final String URL_TASKS_ID_TRANSFER_WORKBASKET_ID = API_V1 + "tasks/{taskId}/transfer/{workbasketId}"; + // task comment endpoints public static final String URL_TASK_COMMENTS = API_V1 + "tasks/{taskId}/comments"; public static final String URL_TASK_COMMENT = API_V1 + "tasks/comments/{taskCommentId}"; - public static final String URL_MONITOR = API_V1 + "monitor"; - public static final String URL_MONITOR_TASKS_STATUS = API_V1 + "monitor/tasks-status-report"; - public static final String URL_MONITOR_TASKS_WORKBASKET = + // monitor endpoints + public static final String URL_MONITOR_TASKS_STATUS_REPORT = + API_V1 + "monitor/tasks-status-report"; + public static final String URL_MONITOR_TASKS_WORKBASKET_REPORT = API_V1 + "monitor/tasks-workbasket-report"; - public static final String URL_MONITOR_TASKS_WORKBASKET_PLANNED = + public static final String URL_MONITOR_TASKS_WORKBASKET_PLANNED_REPORT = API_V1 + "monitor/tasks-workbasket-planned-date-report"; - public static final String URL_MONITOR_TASKS_CLASSIFICATION = + public static final String URL_MONITOR_TASKS_CLASSIFICATION_REPORT = API_V1 + "monitor/tasks-classification-report"; - public static final String URL_MONITOR_TIMESTAMP = API_V1 + "monitor/timestamp-report"; + public static final String URL_MONITOR_TIMESTAMP_REPORT = API_V1 + "monitor/timestamp-report"; public static final String URL_HISTORY_ENABLED = API_V1 + "history-provider-enabled"; public static final String URL_HISTORY_EVENTS = API_V1 + "task-history-event"; 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 ec0f08b66..27b4b19f5 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 @@ -45,7 +45,7 @@ public class MonitorController { this.reportRepresentationModelAssembler = reportRepresentationModelAssembler; } - @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_STATUS) + @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_STATUS_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTasksStatusReport( @RequestParam(required = false) List domains, @@ -69,7 +69,7 @@ public class MonitorController { return response; } - @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_WORKBASKET) + @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_WORKBASKET_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTasksWorkbasketReport( @RequestParam(value = "states") List states) @@ -92,7 +92,7 @@ public class MonitorController { return ResponseEntity.status(HttpStatus.OK).body(report); } - @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_WORKBASKET_PLANNED) + @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_WORKBASKET_PLANNED_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTasksWorkbasketPlannedDateReport( @RequestParam(value = "daysInPast") int daysInPast, @@ -120,7 +120,7 @@ public class MonitorController { return ResponseEntity.status(HttpStatus.OK).body(report); } - @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_CLASSIFICATION) + @GetMapping(path = RestEndpoints.URL_MONITOR_TASKS_CLASSIFICATION_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getTasksClassificationReport() throws NotAuthorizedException, InvalidArgumentException { @@ -140,7 +140,7 @@ public class MonitorController { return ResponseEntity.status(HttpStatus.OK).body(report); } - @GetMapping(path = RestEndpoints.URL_MONITOR_TIMESTAMP) + @GetMapping(path = RestEndpoints.URL_MONITOR_TIMESTAMP_REPORT) @Transactional(readOnly = true, rollbackFor = Exception.class) public ResponseEntity getDailyEntryExitReport() throws NotAuthorizedException, InvalidArgumentException { diff --git a/rest/taskana-rest-spring/src/test/java/pro/taskana/doc/api/MonitorControllerRestDocumentation.java b/rest/taskana-rest-spring/src/test/java/pro/taskana/doc/api/MonitorControllerRestDocumentation.java index 70de7713b..596cf38c1 100644 --- a/rest/taskana-rest-spring/src/test/java/pro/taskana/doc/api/MonitorControllerRestDocumentation.java +++ b/rest/taskana-rest-spring/src/test/java/pro/taskana/doc/api/MonitorControllerRestDocumentation.java @@ -54,7 +54,7 @@ class MonitorControllerRestDocumentation extends BaseRestDocumentation { this.mockMvc .perform( RestDocumentationRequestBuilders.get( - restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_STATUS)) + restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_STATUS_REPORT)) .header("Authorization", ADMIN_CREDENTIALS)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo( @@ -67,7 +67,7 @@ class MonitorControllerRestDocumentation extends BaseRestDocumentation { this.mockMvc .perform( RestDocumentationRequestBuilders.get( - restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_WORKBASKET) + restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_WORKBASKET_REPORT) + "?daysInPast=4&states=READY,CLAIMED,COMPLETED") .accept("application/hal+json") .header("Authorization", ADMIN_CREDENTIALS)) @@ -82,7 +82,7 @@ class MonitorControllerRestDocumentation extends BaseRestDocumentation { this.mockMvc .perform( RestDocumentationRequestBuilders.get( - restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_CLASSIFICATION)) + restHelper.toUrl(RestEndpoints.URL_MONITOR_TASKS_CLASSIFICATION_REPORT)) .accept("application/hal+json") .header("Authorization", ADMIN_CREDENTIALS)) .andExpect(MockMvcResultMatchers.status().isOk()) @@ -96,7 +96,7 @@ class MonitorControllerRestDocumentation extends BaseRestDocumentation { this.mockMvc .perform( RestDocumentationRequestBuilders.get( - restHelper.toUrl(RestEndpoints.URL_MONITOR_TIMESTAMP)) + restHelper.toUrl(RestEndpoints.URL_MONITOR_TIMESTAMP_REPORT)) .accept("application/hal+json") .header("Authorization", ADMIN_CREDENTIALS)) .andExpect(MockMvcResultMatchers.status().isOk())