Created
November 13, 2024 04:21
-
-
Save guaracyalima/46c84baebe63a5676c6f6d82c5df6aee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Domain | |
@Data | |
@Builder | |
public class Order { | |
private Product product; | |
private ShippingHistory shippingHistory; | |
private Payment payment; | |
} | |
@Data | |
@Builder | |
public class Payment { | |
private String status; | |
} | |
@Entity | |
@NoArgsConstructor | |
@Getter | |
@Setter | |
@Builder | |
@AllArgsConstructor | |
public class Product implements Serializable { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
@NotBlank(message = "Product name is mandatory") | |
private String name; | |
private String description; | |
@NotBlank(message = "Product price is mandatory") | |
private Double price; | |
} | |
@Data | |
@Builder | |
public class ShippingHistory { | |
private String lastStatus; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment