-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f14f181
commit fb65d91
Showing
11 changed files
with
60 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
package mate.academy.dto.order; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
import java.math.BigDecimal; | ||
import java.time.LocalDateTime; | ||
import java.util.Set; | ||
|
||
public record OrderDto( | ||
@NotNull Long id, | ||
@NotNull Long userId, | ||
@NotBlank String status, | ||
@NotNull @Positive BigDecimal total, | ||
@NotNull LocalDateTime orderDate, | ||
@NotBlank String shippingAddress, | ||
@NotNull Set<OrderItemDto> orderItems | ||
Long id, | ||
Long userId, | ||
String status, | ||
BigDecimal total, | ||
LocalDateTime orderDate, | ||
String shippingAddress, | ||
Set<OrderItemDto> orderItems | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package mate.academy.dto.order; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
import java.math.BigDecimal; | ||
|
||
public record OrderItemDto(@NotNull Long id, | ||
@NotNull Long orderId, | ||
@NotNull Long bookId, | ||
@Positive int quantity, | ||
@Positive BigDecimal price) { | ||
public record OrderItemDto( | ||
Long id, | ||
Long orderId, | ||
Long bookId, | ||
int quantity, | ||
BigDecimal price) { | ||
} |
8 changes: 3 additions & 5 deletions
8
src/main/java/mate/academy/dto/order/PlaceOrderRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
package mate.academy.dto.order; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class PlaceOrderRequestDto { | ||
@NotBlank | ||
private String shippingAddress; | ||
public record PlaceOrderRequestDto( | ||
@NotBlank String shippingAddress | ||
) { | ||
} |
8 changes: 3 additions & 5 deletions
8
src/main/java/mate/academy/dto/order/UpdateOrderStatusRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package mate.academy.dto.order; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Data; | ||
import mate.academy.model.Order; | ||
|
||
@Data | ||
public class UpdateOrderStatusRequestDto { | ||
@NotNull | ||
private Order.Status status; | ||
public record UpdateOrderStatusRequestDto( | ||
@NotNull Order.Status status | ||
) { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/mate/academy/exception/OrderProcessingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package mate.academy.exception; | ||
|
||
public class OrderProcessingException extends RuntimeException { | ||
public OrderProcessingException(String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters