-
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 #6 from Prithvi333/prem1
entity_finished
- Loading branch information
Showing
25 changed files
with
697 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Entity | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Admin { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Integer adminId; | ||
|
||
@NotNull(message = "Name is mandatory") | ||
@Size(min = 3,max = 30,message = "Min 3 and Max 30 Characters is allowed only") | ||
private String adminName; | ||
|
||
@Size(min = 6,max = 10,message = "Min 3 and Max 30 Characters is allowed only") | ||
@NotNull(message = "password is mandatory") | ||
@NotBlank(message = "password is mandatory") | ||
private String password; | ||
|
||
@Email(message = "please provide correct email") | ||
@NotBlank(message = "please provide correct email") | ||
private String email; | ||
|
||
@Size(min = 10,max = 10,message = "Min 10 and Max 30 Characters is allowed only") | ||
@NotNull(message = "mobile is mandatory") | ||
@NotBlank(message = "mobile is mandatory") | ||
private String mobile; | ||
|
||
|
||
@JsonIgnore | ||
@OneToMany(cascade = CascadeType.ALL) | ||
private List<Report> reports; | ||
} |
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,45 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotBlank; | ||
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; | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
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,31 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
public class Bus { | ||
|
||
private Integer busId; | ||
private String busType; | ||
|
||
private String busNumber; | ||
private Integer capacity; | ||
|
||
@ManyToMany(cascade = CascadeType.ALL) | ||
private List<Route> routes; | ||
|
||
|
||
@JoinColumn(name = "travels_id") | ||
@ManyToOne(cascade = CascadeType.ALL) | ||
@JsonIgnore | ||
private Travels travel; | ||
|
||
@ManyToMany(cascade = CascadeType.ALL) | ||
@JoinTable(name = "bus_destination",joinColumns = {@JoinColumn(referencedColumnName = "busId")},inverseJoinColumns = {@JoinColumn(referencedColumnName = "desId")}) | ||
private List<Destination> destinationList; | ||
|
||
|
||
} |
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,74 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Entity | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class Customer { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer customerId; | ||
|
||
@NotBlank(message = "Please provide the customer name") | ||
@NotNull(message = "Please provide the customer name") | ||
private String customerName; | ||
|
||
|
||
@NotBlank(message = "Please provide the customer password") | ||
@NotNull(message = "Please provide the customer password") | ||
@Size(min = 6,max = 10,message = "min 6 and max 10 characters allowed only") | ||
private String customerPassword; | ||
|
||
@NotBlank(message = "Please provide the customer password") | ||
@NotNull(message = "Please provide the customer password") | ||
@Size(min = 6,message = "min 6 is characters required") | ||
private String address; | ||
|
||
@NotBlank(message = "Please provide the customer password") | ||
@NotNull(message = "Please provide the customer password") | ||
@Size(min = 6,max = 10,message = "min 15 and max 15 characters allowed only") | ||
private String aadharId; | ||
|
||
|
||
@NotBlank(message = "Please select gender") | ||
@NotNull(message = "Please select gender") | ||
private Gender gender; | ||
|
||
@NotBlank(message = "Please select your country") | ||
@NotNull(message = "Please select your country") | ||
private String country; | ||
|
||
|
||
@NotBlank(message = "Please provide the customer password") | ||
@NotNull(message = "Please provide the customer password") | ||
@Size(min = 10,max = 10,message = "min 10 and max 10 characters allowed only") | ||
private String mobileNo; | ||
|
||
@Email(message = "email is not in correct format") | ||
@NotBlank(message = "Please provide the email") | ||
@NotNull(message = "Please provide the email") | ||
private String email; | ||
|
||
|
||
@OneToOne(cascade = CascadeType.ALL) | ||
@JoinColumn(name = "booking_id") | ||
private Booking booking; | ||
|
||
@JsonIgnore | ||
@OneToMany(cascade = CascadeType.ALL,mappedBy = "customer") | ||
private List<Feedback> feedback; | ||
} |
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 DesEnvironment { | ||
|
||
HOT,COLD,NORMAL | ||
} |
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,23 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToMany; | ||
import jakarta.persistence.OneToMany; | ||
|
||
import java.util.List; | ||
|
||
public class Destination { | ||
|
||
private Integer desId; | ||
private String name; | ||
private DesEnvironment desEnvironment; | ||
|
||
@ManyToMany(cascade = CascadeType.ALL,mappedBy = "destinationList") | ||
|
||
private List<Bus> bus; | ||
|
||
@OneToMany(mappedBy = "destination",cascade = CascadeType.ALL) | ||
private List<Hotel> hotels; | ||
|
||
} |
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.masaiproject.tripManagement.entities; | ||
|
||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class Feedback { | ||
|
||
private Integer feedbackId; | ||
private String feedback; | ||
private String rating; | ||
|
||
private LocalDate submitDate; | ||
|
||
@ManyToOne() | ||
@JoinColumn(name = "customer_id") | ||
private Customer customer; | ||
} |
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 Gender { | ||
|
||
MALE,FEMALE,OTHER | ||
} |
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,56 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
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.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDate; | ||
|
||
@Entity | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Hotel { | ||
|
||
|
||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer hotelId; | ||
|
||
@NotBlank(message = "Please provide the hotel name") | ||
@NotNull(message = "Please provide the hotel name") | ||
private String hotelName; | ||
|
||
@NotNull(message = "Please provide the hotel type") | ||
@NotEmpty(message = "Please provide the hotel type") | ||
private HotelType hotelType; | ||
|
||
@NotNull(message = "Please provide the hotel description") | ||
@NotEmpty(message = "Please provide the hotel description") | ||
private String hotelDescription; | ||
|
||
@NotNull(message = "Please provide the hotel address") | ||
@NotEmpty(message = "Please provide the hotel address") | ||
private String address; | ||
|
||
@NotNull(message = "Please provide the rent details") | ||
@NotEmpty(message = "Please provide the rent details") | ||
private Double rent; | ||
|
||
@NotNull(message = "Please provide the STATUS") | ||
@NotEmpty(message = "Please provide the STATUS") | ||
private HotelStatus status; | ||
|
||
@JsonIgnore | ||
@ManyToOne(cascade = CascadeType.ALL) | ||
@JoinColumn(name = "destin_id") | ||
private Destination destination; | ||
|
||
|
||
} |
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,18 @@ | ||
package com.masaiproject.tripManagement.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.persistence.*; | ||
|
||
@Entity | ||
@PrimaryKeyJoinColumn(name = "hotel_booking_id") | ||
public class HotelBooking extends Booking{ | ||
|
||
@JsonIgnore | ||
@OneToOne(cascade = CascadeType.ALL,mappedBy = "booking") | ||
private Customer customer; | ||
|
||
|
||
@OneToOne(cascade = CascadeType.ALL) | ||
private Hotel hotel; | ||
|
||
} |
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 HotelStatus { | ||
|
||
OPEN,CLOSED,FILLED,VACANT | ||
} |
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 HotelType { | ||
|
||
ONE_STAR,TWO_STAR,THREE_STAR,FOUR_STAR,FIVE_START | ||
} |
Oops, something went wrong.