-
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
Showing
8 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/com/vedasole/ekartecommercebackend/payload/AddressDto.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,19 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import com.vedasole.ekartecommercebackend.entity.Address; | ||
import lombok.Builder; | ||
|
||
import javax.validation.constraints.*; | ||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* DTO for {@link Address} | ||
*/ | ||
@Builder | ||
public record AddressDto(long addressId, String addLine1, String addLine2, @NotNull @NotEmpty @NotBlank String city, | ||
@NotNull @NotEmpty @NotBlank String state, @NotNull @NotEmpty @NotBlank String country, | ||
@Min(5) @Max(value = 6, message = "Postal code should be not greater than 5 characters") int postalCode) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 4607115799900867635L; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/vedasole/ekartecommercebackend/payload/ApiResponse.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,15 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ApiResponse { | ||
|
||
private String message; | ||
|
||
private boolean success; | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/vedasole/ekartecommercebackend/payload/CategoryDto.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,13 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* DTO for {@link com.vedasole.ekartecommercebackend.entity.Category} | ||
*/ | ||
public record CategoryDto(long categoryId, String name, String image, String desc, | ||
long parentCategory, boolean isActive) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = -6361844320830928689L; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/vedasole/ekartecommercebackend/payload/CustomerDto.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,16 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* DTO for {@link com.vedasole.ekartecommercebackend.entity.Customer} | ||
*/ | ||
public record CustomerDto(long customerId, String firstName, String lastName, long phoneNumber, String email, | ||
LocalDateTime createDt, @NotNull AddressDto address) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = -4970632778733952870L; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/vedasole/ekartecommercebackend/payload/OrderDetailDto.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,17 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import com.vedasole.ekartecommercebackend.entity.OrderDetail; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* DTO for {@link OrderDetail} | ||
*/ | ||
public record OrderDetailDto(long orderDetailsId, @NotNull OrderDto order, long productProductId, String productName, | ||
String productImage, String productDesc, double productPrice, int productQtyInStock, | ||
CategoryDto productCategory) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = -5054394287337400890L; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/vedasole/ekartecommercebackend/payload/OrderDto.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,21 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import com.vedasole.ekartecommercebackend.entity.Order; | ||
import com.vedasole.ekartecommercebackend.entity.OrderDetail; | ||
import com.vedasole.ekartecommercebackend.utility.OrderStatus; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import java.util.Set; | ||
|
||
/** | ||
* DTO for {@link Order} | ||
*/ | ||
public record OrderDto(long orderId, @NotNull CustomerDto customer, @NotNull Set<OrderDetail> orderDetails, | ||
@NotNull AddressDto address, LocalDateTime orderDt, double total, | ||
OrderStatus orderStatus) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 4761708818033261120L; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/vedasole/ekartecommercebackend/payload/ProductDto.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,16 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import com.vedasole.ekartecommercebackend.entity.Product; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* DTO for {@link Product} | ||
*/ | ||
public record ProductDto(long productId, String name, String image, String desc, double price, int qtyInStock, | ||
@NotNull CategoryDto category) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 2079394134035966353L; | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/vedasole/ekartecommercebackend/payload/ShoppingCartDto.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,20 @@ | ||
package com.vedasole.ekartecommercebackend.payload; | ||
|
||
import com.vedasole.ekartecommercebackend.entity.ShoppingCart; | ||
import com.vedasole.ekartecommercebackend.entity.ShoppingCartItem; | ||
import javax.validation.constraints.NotNull; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.Set; | ||
|
||
/** | ||
* DTO for {@link ShoppingCart} | ||
*/ | ||
public record ShoppingCartDto(long cartId, @NotNull CustomerDto customerId, | ||
@NotNull Set<ShoppingCartItem> shoppingCartItems) implements Serializable { | ||
@Serial | ||
private static final long serialVersionUID = 2151030173521724266L; | ||
|
||
|
||
} |