Skip to content

Commit

Permalink
Annotations changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizerpwn committed May 28, 2024
1 parent a79a51a commit 423574a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@SpringBootApplication
@EnableJpaRepositories
@RequiredArgsConstructor
public class OrderManagementApplication implements CommandLineRunner {
private final AddressService addressService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private void removeProductFromCart(String productIdToRemove) {

private void finishOrder() {
try {
if (currentOrder.size() == 0) {
if (currentOrder.isEmpty()) {
System.out.println("ERROR: Your cart is currently empty, so order is not created.");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.PositiveOrZero;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down Expand Up @@ -49,6 +50,6 @@ public class Product {

@Column(name = "available_quantity", nullable = false)
@NotNull
@Positive(message = "Available quantity must be bigger than zero")
@PositiveOrZero(message = "Available quantity must be bigger or equal to zero")
private int availableQuantity;
}

0 comments on commit 423574a

Please sign in to comment.