Skip to content

Commit

Permalink
Merge pull request #107 from JewelleryManagement/Change-the-possible-…
Browse files Browse the repository at this point in the history
…discount-range-for-a-resource

Added new restriction to ResourceQuantityRequestDto for discount
  • Loading branch information
LuboKar authored Apr 11, 2024
2 parents bdcfc26 + 1ff179d commit ac66756
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package jewellery.inventory.dto.request;

import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.math.BigDecimal;

import jewellery.inventory.dto.request.resource.ResourceQuantityRequestDto;
import lombok.*;
import lombok.experimental.SuperBuilder;
Expand All @@ -17,5 +17,8 @@ public class PurchasedResourceQuantityRequestDto {

@NotNull private ResourceQuantityRequestDto resourceAndQuantity;

@Positive private BigDecimal discount;
@NotNull
@DecimalMin(value = "0")
@DecimalMax(value = "100")
private BigDecimal discount;
}

0 comments on commit ac66756

Please sign in to comment.