Skip to content

Commit

Permalink
1.Added @notblank to the ISBN field in the Book DTO
Browse files Browse the repository at this point in the history
 2.Removed @notblank from the role field in the Members DTO
  • Loading branch information
anishmu20 committed Nov 9, 2024
1 parent 02ea615 commit fa9e302
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/com/libraryman_api/book/BookDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class BookDto {
@Size(min = 1, max = 100, message = "Author name must be between 1 and 100 characters")
private String author;

@NotBlank(message = "isbn is required")
@Pattern(regexp = "^(978|979)-\\d{10}$", message = "Invalid ISBN format. Format must be '978-XXXXXXXXXX' or '979-XXXXXXXXXX'")
private String isbn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MembersDto {
message = "Password must contain at least one letter, one number, and one special character")
private String password;

@NotBlank(message = "Role is required")

private Role role;

private Date membershipDate;
Expand Down

0 comments on commit fa9e302

Please sign in to comment.