Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ public TaskResource mapToApiFirstTaskResource(CreateTaskRequestTask request) {
taskTitle != null ? taskTitle : taskName,
request.getDescription(),
new ArrayList<NoteResource>(),
majorPriority != null ? majorPriority : 5000,
minorPriority != null ? minorPriority : 500,
majorPriority,
minorPriority,
null, //Need to get from taskPayload assignee
false, //autoAssigned
executionTypeResource,
Expand Down Expand Up @@ -915,6 +915,7 @@ public TaskResource mapToTaskResourceForReconfigure(TaskResource taskResource, T
taskResource.setPriorityDate(task.getPriorityDate());
taskResource.setMajorPriority(task.getMajorPriority());
taskResource.setMinorPriority(task.getMinorPriority());

String taskId = task.getId().toString();
Set<TaskRoleResource> taskRoleResources = mapPermissions(task.getPermissions(), taskId);
taskResource.setTaskRoleResources(taskRoleResources);
Expand All @@ -926,15 +927,23 @@ public TaskResource mapToTaskResourceForReconfigure(TaskResource taskResource, T
taskResource.setRoleCategory(task.getRoleCategory());
taskResource.setNextHearingDate(task.getNextHearingDate());
taskResource.setNextHearingId(task.getNextHearingId());
Map<String, String> additionalProperties = Collections.emptyMap();
Map<String, String> additionalProperties = new ConcurrentHashMap<>();

// Start with existing values if present
if (taskResource.getAdditionalProperties() != null
&& !taskResource.getAdditionalProperties().isEmpty()) {
additionalProperties.putAll(taskResource.getAdditionalProperties());
}

// Merge / update with new values from task
if (task.getAdditionalProperties() != null) {
additionalProperties = task.getAdditionalProperties().entrySet()
.stream()
.collect(Collectors.toMap(
Map.Entry::getKey,
e -> String.valueOf(e.getValue())
));
task.getAdditionalProperties().forEach(
(key, value) -> additionalProperties.put(key, String.valueOf(value)) // put() handles both add & update
);
}


// Set back to resource
taskResource.setAdditionalProperties(additionalProperties);
return taskResource;
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/api-specs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ components:
major_priority:
type: integer
description: Major priority level.
default: 5000
minor_priority:
type: integer
description: Minor priority level.
default: 500
location_name:
type: string
description: Location display name.
Expand Down Expand Up @@ -514,6 +516,10 @@ components:
- case_name
- region
- location
- role_category
- title
- major_priority
- minor_priority
description: Task attributes that can be updated during reconfiguration.
properties:
id:
Expand Down