-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add validation to request body and method renaming
- Loading branch information
Showing
10 changed files
with
61 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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
6 changes: 6 additions & 0 deletions
6
src/main/java/org/umaxcode/domain/dto/request/ReassignTaskDto.java
This file contains 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,6 +1,12 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record ReassignTaskDto( | ||
|
||
@NotBlank(message = "User email is required") | ||
@Email(message = "Invalid email") | ||
String userEmail | ||
) { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/org/umaxcode/domain/dto/request/TaskCommentUpdateDto.java
This file contains 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,6 +1,10 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record TaskCommentUpdateDto( | ||
|
||
@NotBlank(message = "Comment is required") | ||
String comment | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/umaxcode/domain/dto/request/TaskDetailsUpdateDto.java
This file contains 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,7 +1,13 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record TaskDetailsUpdateDto( | ||
|
||
@NotBlank(message = "Name is required") | ||
String name, | ||
|
||
@NotBlank(message = "Description is required") | ||
String description | ||
) { | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/umaxcode/domain/dto/request/TaskReopenDto.java
This file contains 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,8 +1,14 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.Future; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record TaskReopenDto( | ||
|
||
@NotBlank(message = "Deadline is required") | ||
@Future(message = "Deadline must be in the future") | ||
LocalDateTime deadline | ||
) { | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/umaxcode/domain/dto/request/TasksCreationDto.java
This file contains 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,11 +1,25 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.Future; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public record TasksCreationDto( | ||
|
||
@NotBlank(message = "Name is required") | ||
String name, | ||
|
||
@NotBlank(message = "Description is required") | ||
String description, | ||
|
||
@NotBlank(message = "Deadline is required") | ||
@Future(message = "Deadline must be in the future") | ||
LocalDateTime deadline, | ||
|
||
@NotBlank(message = "Deadline is required") | ||
@Email(message = "Invalid email") | ||
String responsibility | ||
) { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/umaxcode/domain/dto/request/UserCreationDto.java
This file contains 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,7 +1,15 @@ | ||
package org.umaxcode.domain.dto.request; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record UserCreationDto( | ||
|
||
@NotBlank(message = "Username is required") | ||
String username, | ||
|
||
@NotBlank(message = "Email is required") | ||
@Email(message = "Invalid email") | ||
String email | ||
) { | ||
} |
This file contains 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 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