-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature] Make task creation and updates an atomic operation #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
87c1950
feat: update create and update DTOs to exclude file ids
solenuk ea145ca
feat(filemanager): add new facade methods for file detachment and fil…
solenuk 33f6862
feat: update task controller and service to handle MultipartFiles
solenuk 9e568a3
feat: update module dependencies
solenuk 10f0f2d
feat: update task facade method
solenuk 466c470
feat: update UpdateTaskRequestDTO
solenuk a773a22
feat(taskassignment): update assignment module to support MultipartFi…
solenuk 75660c5
test: update unit tests
solenuk 062e6e8
fix: coderabbit issues
solenuk daa5537
fix: coderabbit issues
solenuk a85b3b3
fix: coderabbit issue
solenuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
src/main/java/com/itasocialacademy/oitassist/task/dto/request/UpdateTaskRequestDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,34 @@ | ||
| package com.itasocialacademy.oitassist.task.dto.request; | ||
|
|
||
| import com.itasocialacademy.oitassist.filemanager.dao.enums.FileRole; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| @Schema(description = "DTO for updating an already existing task") | ||
| public record UpdateTaskRequestDTO( | ||
| @Schema( | ||
| description = "Updated title of the task", | ||
| example = "Оновлена назва завдання", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank String title, | ||
|
|
||
| @Schema( | ||
| description = "Updated description of the task", | ||
| example = "Оновлений опис завдання", | ||
| requiredMode = Schema.RequiredMode.NOT_REQUIRED) String description, | ||
| @Schema( | ||
| description = "New and already attached ids of files", | ||
| example = "[51,62]", | ||
| requiredMode = Schema.RequiredMode.NOT_REQUIRED) List<Long> fileIds, | ||
|
|
||
| @Schema( | ||
| description = "File ids to be detached from task", | ||
| example = "[52]", | ||
| requiredMode = Schema.RequiredMode.NOT_REQUIRED) List<Long> removedFileIds, | ||
|
|
||
| @Schema( | ||
| description = "Map of existing file ID → new FileRole for role updates", | ||
| example = "{\"51\": \"SOLUTION\"}", | ||
| requiredMode = Schema.RequiredMode.NOT_REQUIRED) Map<Long, FileRole> roleUpdates, | ||
|
|
||
| @Schema(description = "Optimistic locking version; must be echoed back on updates", | ||
| requiredMode = Schema.RequiredMode.REQUIRED) @NotNull Long version) { | ||
| } |
4 changes: 2 additions & 2 deletions
4
src/main/java/com/itasocialacademy/oitassist/task/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: ita-social-projects/oitAssist
Length of output: 50385
🏁 Script executed:
Repository: ita-social-projects/oitAssist
Length of output: 15069
🏁 Script executed:
Repository: ita-social-projects/oitAssist
Length of output: 50386
🏁 Script executed:
Repository: ita-social-projects/oitAssist
Length of output: 17362
Add compensation for successful storage uploads.
TaskServiceImpl.createTaskinvokesStorageProvider.uploadbeforeFileServiceImplsaves eachFileAsset. If a later upload fails, the transaction can roll back the metadata while earlier physical objects remain orphaned. Track successful storage keys and delete them when the task transaction fails.🤖 Prompt for AI Agents