Changeset 3d60932 for src/main/java/com/example
- Timestamp:
- 02/13/25 10:05:35 (4 months ago)
- Branches:
- master
- Children:
- a70b5a4
- Parents:
- 57e58a3
- Location:
- src/main/java/com/example/skychasemk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/skychasemk/dto/BookingDTO.java
r57e58a3 r3d60932 10 10 private Integer bookingID; 11 11 private Integer userID; 12 private FlightflightId;12 private Integer flightId; 13 13 private LocalDate bookingDate; 14 14 private PaymentStatus status; … … 16 16 private Integer seatNumber; 17 17 18 public FlightgetFlightId() {18 public Integer getFlightId() { 19 19 return flightId; 20 20 } 21 21 22 public void setFlightId( FlightflightId) {22 public void setFlightId(Integer flightId) { 23 23 this.flightId = flightId; 24 24 } … … 47 47 } 48 48 49 public FlightgetFlightID() {49 public Integer getFlightID() { 50 50 return flightId; 51 51 } 52 52 53 public void setFlightID( FlightflightId) {53 public void setFlightID(Integer flightId) { 54 54 this.flightId = flightId; 55 55 } -
src/main/java/com/example/skychasemk/dto/PaymentDTO.java
r57e58a3 r3d60932 2 2 3 3 import lombok.Getter; 4 import lombok.Setter; 4 5 5 6 import java.math.BigDecimal; … … 12 13 private Long paymentID; 13 14 @Getter 14 private Integer bookingI D;15 private Integer bookingId; 15 16 private Integer userID; 16 17 @Getter … … 22 23 @Getter 23 24 private PaymentStatus status; 25 @Setter 24 26 @Getter 25 27 private Long flightId; 26 27 public void setFlightId(Long flightId) {28 this.flightId = flightId;29 }30 28 31 29 public enum PaymentStatus { … … 40 38 CREDIT 41 39 } 42 40 public Integer getBookingID() { 41 return bookingId; 42 } 43 43 public void setPaymentID(Long paymentID) { 44 44 this.paymentID = paymentID; 45 45 } 46 46 47 public void setBookingID(Integer bookingID) {48 this.bookingID = bookingID;49 }50 47 51 48 public Long getUserID() { -
src/main/java/com/example/skychasemk/model/Administrator.java
r57e58a3 r3d60932 6 6 @Entity 7 7 @Data 8 @Table(name=" Administrator")8 @Table(name="administrator") 9 9 public class Administrator { 10 10 @Id -
src/main/java/com/example/skychasemk/model/Airport.java
r57e58a3 r3d60932 4 4 5 5 @Entity 6 @Table(name=" Airport")6 @Table(name="airport") 7 7 public class Airport { 8 8 9 9 @Id 10 10 @GeneratedValue(strategy = GenerationType.IDENTITY) 11 @Column(name = " AirportID")11 @Column(name = "airportid") 12 12 private Integer airportID; 13 13 @Column(name = "name") -
src/main/java/com/example/skychasemk/model/ApplicationUser.java
r57e58a3 r3d60932 9 9 @Entity 10 10 @Data 11 @Table(name=" ApplicationUser")11 @Table(name="application_user") 12 12 public class ApplicationUser { 13 13 … … 29 29 30 30 private String password; 31 @Column(name = "phone Number")31 @Column(name = "phone_number") 32 32 33 33 private String phoneNumber; 34 34 35 @Column(name = "date Joined")35 @Column(name = "date_joined") 36 36 private LocalDate dateJoined; 37 37 -
src/main/java/com/example/skychasemk/model/Booking.java
r57e58a3 r3d60932 9 9 10 10 @Entity 11 @Table(name=" Booking")11 @Table(name="booking") 12 12 public class Booking { 13 13 … … 16 16 @Id 17 17 @GeneratedValue(strategy = GenerationType.IDENTITY) 18 @Column(name = " BookingID")18 @Column(name = "bookingid") 19 19 20 20 private Integer bookingID; 21 21 @Setter 22 22 @Getter 23 @Column(name = " UserID")23 @Column(name = "userid") 24 24 25 25 private Integer userID; 26 26 27 //@Column(name = "flightid")28 29 //private Integer flightId;30 27 @Column(name = "booking_date") 31 28 … … 44 41 private Integer seat_number; 45 42 46 @ManyToOne(fetch = FetchType.LAZY) 47 @JoinColumn(name = "flightid") 48 Flight flightId; 43 @Column(name = "flightid") 44 private Integer flightId; 49 45 50 public FlightgetFlightId() {46 public Integer getFlightId() { 51 47 return flightId; 52 48 } 53 49 54 public void setFlightId( FlightflightId) {50 public void setFlightId(Integer flightId) { 55 51 this.flightId = flightId; 56 52 } -
src/main/java/com/example/skychasemk/model/Destination.java
r57e58a3 r3d60932 6 6 7 7 @Entity 8 @Table(name=" Destination")8 @Table(name="destination") 9 9 public class Destination { 10 10 11 11 @Id 12 12 @GeneratedValue(strategy = GenerationType.IDENTITY) 13 @Column(name = " DestinationID")13 @Column(name = "destinationid") 14 14 15 15 private Integer destinationID; 16 @Column(name = " Name")16 @Column(name = "name") 17 17 18 18 private String name; 19 @Column(name = " Country")19 @Column(name = "country") 20 20 21 21 private String country; 22 @Column(name = " Description")22 @Column(name = "description") 23 23 24 24 private String description; -
src/main/java/com/example/skychasemk/model/Flight.java
r57e58a3 r3d60932 1 1 package com.example.skychasemk.model; 2 2 3 import com.fasterxml.jackson.annotation.JsonIgnore; 3 4 import jakarta.persistence.*; 4 5 import lombok.Getter; … … 42 43 43 44 private Integer availableSeats; 44 @Column(name = "departure Date")45 @Column(name = "departure_date") 45 46 46 47 private LocalDate departureDate; 47 48 48 @Column(name="return Date")49 @Column(name="return_date") 49 50 private LocalDate returnDate; 50 51 51 52 @OneToMany(mappedBy = "flightId", fetch = FetchType.LAZY) 53 @JsonIgnore 52 54 private List<Booking> bookings; 55 56 public Flight(){} 53 57 54 58 } -
src/main/java/com/example/skychasemk/model/Notification.java
r57e58a3 r3d60932 5 5 6 6 @Entity 7 @Table(name=" Notification")7 @Table(name="notification") 8 8 public class Notification { 9 9 10 10 @Id 11 11 @GeneratedValue(strategy = GenerationType.IDENTITY) 12 @Column(name = " NotificationID")12 @Column(name = "notificationid") 13 13 14 14 private Integer notificationID; 15 @Column(name = " UserID")15 @Column(name = "userid") 16 16 17 17 private Integer userID; 18 @Column(name = " Message")18 @Column(name = "message") 19 19 20 20 private String message; 21 @Column(name = " Type")21 @Column(name = "type") 22 22 23 23 @Enumerated(EnumType.STRING) -
src/main/java/com/example/skychasemk/model/Payment.java
r57e58a3 r3d60932 19 19 private Integer paymentID; 20 20 21 @Column(name = " BookingID")21 @Column(name = "bookingid") 22 22 23 23 private Integer bookingID; -
src/main/java/com/example/skychasemk/model/SupportTicket.java
r57e58a3 r3d60932 19 19 20 20 private Integer userID; 21 @Column(name = "Subject")22 21 23 private String subject;24 22 @Getter 25 23 @Column(name = "Description") … … 62 60 } 63 61 64 public void setSubject(String subject) {65 this.subject = subject;66 }67 62 68 63 public void setDescription(String description) { -
src/main/java/com/example/skychasemk/repository/FlightRepository.java
r57e58a3 r3d60932 13 13 public interface FlightRepository extends JpaRepository<Flight, Long> { 14 14 15 @Query(value = "SELECT * FROM flight WHERE departure_airport = :departureID AND arrival_airport = :destinationID AND departure Date = :departureDate", nativeQuery = true)15 @Query(value = "SELECT * FROM flight WHERE departure_airport = :departureID AND arrival_airport = :destinationID AND departure_date = :departureDate", nativeQuery = true) 16 16 List<Flight> findFlights(@Param("departureID") Integer departureID, 17 17 @Param("destinationID") Integer destinationID, -
src/main/java/com/example/skychasemk/repository/ReviewRepository.java
r57e58a3 r3d60932 3 3 import com.example.skychasemk.model.Review; 4 4 import org.springframework.data.jpa.repository.JpaRepository; 5 import org.springframework.data.jpa.repository.Query; 6 7 import java.util.List; 5 8 6 9 public interface ReviewRepository extends JpaRepository<Review, Integer> { 7 // Custom queries can be added here if needed 10 @Query("SELECT r from Review r where r.targetID = :flightId") 11 List<Review> findReviews(); 8 12 } 9 13 -
src/main/java/com/example/skychasemk/services/ReviewService.java
r57e58a3 r3d60932 17 17 private ReviewRepository reviewRepository; 18 18 19 // Get all reviews20 19 public List<Review> getAllReviews() { 21 return reviewRepository.find All();20 return reviewRepository.findReviews(); 22 21 } 23 22 24 // Get review by ID25 23 public Optional<Review> getReviewById(Integer reviewID) { 26 24 return reviewRepository.findById(reviewID); -
src/main/java/com/example/skychasemk/services/SupportTicketService.java
r57e58a3 r3d60932 41 41 ticket.setDateCreated(LocalDate.now()); 42 42 ticket.setStatus(OPEN); 43 ticket.setSubject("Issue Opened");44 43 ticket.setDescription(dto.getDescription()); 45 44
Note:
See TracChangeset
for help on using the changeset viewer.