-
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.
Merge pull request #8 from Prithvi333/prem2
updated entity
- Loading branch information
Showing
10 changed files
with
200 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,68 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
//package com.masaiproject.tripManagement.entities; | ||
// | ||
//import com.fasterxml.jackson.annotation.JsonIgnore; | ||
//import com.fasterxml.jackson.annotation.JsonSetter; | ||
//import jakarta.persistence.*; | ||
//import jakarta.validation.constraints.NotBlank; | ||
//import jakarta.validation.constraints.NotEmpty; | ||
//import jakarta.validation.constraints.NotNull; | ||
//import lombok.AllArgsConstructor; | ||
//import lombok.Data; | ||
//import lombok.NoArgsConstructor; | ||
//import org.springframework.data.annotation.CreatedDate; | ||
// | ||
//import java.time.LocalDate; | ||
//import java.util.List; | ||
// | ||
// | ||
//@Entity | ||
//@Inheritance(strategy = InheritanceType.JOINED) | ||
//@NoArgsConstructor | ||
//@AllArgsConstructor | ||
//@Data | ||
//public class Booking { | ||
// | ||
// @Id | ||
// @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
// private Integer bookingId; | ||
// | ||
// @NotNull(message = "booking type is important") | ||
// private String bookingType; | ||
// | ||
// | ||
// private String description; | ||
// | ||
// @NotNull(message = "give any booking title") | ||
// private String bookingTitle; | ||
// | ||
// @CreatedDate | ||
// private LocalDate bookingDate; | ||
// | ||
// | ||
// @NotNull(message = "choose the package") | ||
// @NotBlank(message = "choose the package") | ||
// private String packageName; | ||
// | ||
// @NotNull(message = "mention the number of person that will be in this trip") | ||
// private Integer number_Of_Person; | ||
// | ||
// | ||
//// @OneToOne(cascade = CascadeType.ALL) | ||
//// private Package aPackage; | ||
// | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.annotation.CreatedDate; | ||
|
||
import java.time.LocalDate; | ||
|
||
|
||
@Entity | ||
@Inheritance(strategy = InheritanceType.JOINED) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Booking { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer bookingId; | ||
|
||
@NotNull(message = "booking type is important") | ||
private String bookingType; | ||
|
||
|
||
private String description; | ||
|
||
@NotNull(message = "give any booking title") | ||
private String bookingTitle; | ||
|
||
@CreatedDate | ||
private LocalDate bookingDate; | ||
|
||
@NotNull(message = "mention the number of person that will be in this trip") | ||
@NotBlank(message = "mention the number of person that will be in this trip") | ||
private Integer number_Of_Person; | ||
|
||
@NotNull(message = "you have to choose a package") | ||
@NotEmpty(message = "you have to choose a package") | ||
@OneToOne(cascade = CascadeType.ALL) | ||
private Package aPackage; | ||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
import jakarta.persistence.OneToMany; | ||
|
||
//@OneToMany(cascade = CascadeType.ALL) | ||
// @JsonIgnore | ||
// private List<PaymentDetails> payment; | ||
//// | ||
//// @JoinColumn(name = "customer_id") | ||
//// @ManyToOne(cascade = CascadeType.ALL) | ||
//// @JsonIgnore | ||
//// private Customer customerBooking; | ||
// | ||
// | ||
// | ||
//} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.aspectj.bridge.Message; | ||
|
||
@Embeddable | ||
import java.math.BigDecimal; | ||
|
||
@Entity | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PaymentDetails { | ||
|
||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer paymentId; | ||
|
||
@NotNull(message = "type can not be null") | ||
private PaymentType paymentType; | ||
|
||
private double paymentMoney; | ||
private PaymentStatus paymentStatus; | ||
|
||
// @Column(name = "payment_money", columnDefinition = "DECIMAL(10, 2) DEFAULT 0.0") | ||
|
||
@NotNull(message = "money can not be null") | ||
private BigDecimal paymentMoney ; | ||
|
||
private Integer bookingId; | ||
|
||
|
||
} |
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,6 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
public enum PaymentStatus { | ||
|
||
PENDING,FAILED,COMPLETED | ||
} |