Skip to content

Commit

Permalink
revise type from integer to bigdecimal for story5
Browse files Browse the repository at this point in the history
  • Loading branch information
PirompatA committed Mar 31, 2024
1 parent 90e8b5e commit 8ed8658
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

import java.math.BigDecimal;

public record CartRequest(String sku, String name, BigDecimal price, Integer quantity, String promotionCodes, BigDecimal discount) {
public record CartRequest(String sku, String name, BigDecimal price, BigDecimal quantity, String promotionCodes, BigDecimal discount) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.function.BiFunction;

@Data
@NoArgsConstructor
Expand All @@ -31,7 +32,7 @@ public class CartItem {
private BigDecimal price;

@Column(name = "quantity")
private Integer quantity;
private BigDecimal quantity;

@Column(name = "discount")
private BigDecimal discount;
Expand Down Expand Up @@ -79,11 +80,11 @@ public void setPrice(BigDecimal price) {
this.price = price;
}

public Integer getQuantity() {
public BigDecimal getQuantity() {
return quantity;
}

public void setQuantity(Integer quantity) {
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}

Expand Down

0 comments on commit 8ed8658

Please sign in to comment.