Validation tightening (DTOs)
This commit is contained in:
@ -7,9 +7,9 @@ import java.util.*;
|
||||
public class ProjectTaskDtos {
|
||||
// Projects
|
||||
public record CreateProjectRequest(
|
||||
@NotNull UUID householdId,
|
||||
@NotBlank String name,
|
||||
String description
|
||||
@NotNull(message = "householdId is required") UUID householdId,
|
||||
@NotBlank(message = "name is required") String name,
|
||||
@Size(max = 2000, message = "description too long") String description
|
||||
) {}
|
||||
|
||||
public record ProjectResponse(
|
||||
@ -20,30 +20,30 @@ public class ProjectTaskDtos {
|
||||
|
||||
// Project tasks (existing)
|
||||
public record CreateTaskRequest(
|
||||
@NotNull UUID projectId,
|
||||
@NotBlank String title,
|
||||
String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE") String status,
|
||||
@NotNull(message = "projectId is required") UUID projectId,
|
||||
@NotBlank(message = "title is required") String title,
|
||||
@Size(max = 8000, message = "description too long") String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH", message="priority must be LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE", message="status must be OPEN|IN_PROGRESS|DONE") String status,
|
||||
LocalDate dueDate,
|
||||
String assigneeSub
|
||||
) {}
|
||||
|
||||
// Household tasks (new) – no projectId
|
||||
public record CreateHouseholdTaskRequest(
|
||||
@NotBlank String title,
|
||||
String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE") String status,
|
||||
@NotBlank(message = "title is required") String title,
|
||||
@Size(max = 8000, message = "description too long") String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH", message="priority must be LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE", message="status must be OPEN|IN_PROGRESS|DONE") String status,
|
||||
LocalDate dueDate,
|
||||
String assigneeSub
|
||||
) {}
|
||||
|
||||
public record UpdateTaskRequest(
|
||||
String title,
|
||||
String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE") String status,
|
||||
@Size(min = 1, max = 200, message = "title must be 1..200 characters") String title,
|
||||
@Size(max = 8000, message = "description too long") String description,
|
||||
@Pattern(regexp="LOW|MEDIUM|HIGH", message="priority must be LOW|MEDIUM|HIGH") String priority,
|
||||
@Pattern(regexp="OPEN|IN_PROGRESS|DONE", message="status must be OPEN|IN_PROGRESS|DONE") String status,
|
||||
LocalDate dueDate,
|
||||
String assigneeSub
|
||||
) {}
|
||||
@ -57,4 +57,12 @@ public class ProjectTaskDtos {
|
||||
LocalDate dueDate,
|
||||
String assigneeSub
|
||||
) {}
|
||||
|
||||
// ---- Filters + paging helper ----
|
||||
public record TaskFilter(
|
||||
String status, // OPEN|IN_PROGRESS|DONE
|
||||
String priority, // LOW|MEDIUM|HIGH
|
||||
LocalDate dueFrom,
|
||||
LocalDate dueTo
|
||||
) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user