Commit bf355673 authored by Michaela Korenková's avatar Michaela Korenková
Browse files

Merge branch 'feature/fixes/korenkova' into 'main'

Feature/fixes/korenkova

See merge request !48
parents e6720ecf 7079a779
Pipeline #141200 passed with stages
in 2 minutes and 25 seconds
......@@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.modelmapper.ModelMapper;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
/**
* @author Jakub Balga
......@@ -29,7 +29,7 @@ public class GrapeUpsertViewModel extends ViewModelBase {
/**
* name of grape variety
*/
@NotNull(message = "Cannot be empty")
@NotBlank(message = "Cannot be empty")
private String name;
public GrapeDto toDto() {
......
......@@ -9,9 +9,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.modelmapper.ModelMapper;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;
......@@ -36,7 +34,8 @@ public class WineBottleUpsertViewModel extends ViewModelBase {
/**
* name of wine bottle
*/
@NotNull(message = "Cannot be empty")
@NotBlank(message = "Cannot be empty")
@Pattern(regexp = "^[\\w0-9 ]+$", message = "Please enter only alphanumerical characters and spaces")
private String name;
/**
......@@ -50,14 +49,14 @@ public class WineBottleUpsertViewModel extends ViewModelBase {
* volume of bottle
*/
@NotNull(message = "Cannot be empty")
@PositiveOrZero(message = "Has to be a non-negative number")
@Positive(message = "Has to be a positive number")
private BigDecimal volume;
/**
* price of bottle
*/
@NotNull(message = "Cannot be empty")
@PositiveOrZero(message = "Has to be a non-negative number")
@Positive(message = "Has to be a positive number")
private BigDecimal price;
/**
......
......@@ -9,7 +9,9 @@ import lombok.Setter;
import org.modelmapper.ModelMapper;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;
/**
......@@ -32,7 +34,8 @@ public class WineTypeUpsertViewModel extends ViewModelBase {
/**
* name of wine type
*/
@NotNull(message = "Cannot be empty")
@NotBlank(message = "Cannot be empty")
@Pattern(regexp = "^[\\w0-9 ]+$", message = "Please enter only alphanumerical characters and spaces")
private String name;
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment