Ignore:
Timestamp:
04/28/25 14:21:17 (3 weeks ago)
Author:
Aleksandar Panovski <apano77@…>
Branches:
main
Children:
e15e8d9
Parents:
f5b256e
Message:

Big change done fully handle_reservation_update() trigger works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/rezevirajmasa/demo/dto/ReservationDTO.java

    rf5b256e rdeea3c4  
    1 package com.example.rezevirajmasa.demo.dto;public class ReservationDTO {
     1package com.example.rezevirajmasa.demo.dto;
     2
     3import com.example.rezevirajmasa.demo.model.Reservation;
     4import com.example.rezevirajmasa.demo.model.Restaurant;
     5
     6import java.math.BigDecimal;
     7import java.time.LocalDateTime;
     8
     9public class ReservationDTO {
     10    private Long reservationID;
     11    private String userEmail;
     12    private BigDecimal rating;
     13    private Long tableNumber;
     14    private LocalDateTime reservationDateTime;
     15    private LocalDateTime checkInTime;
     16    private Restaurant restaurant;
     17    private int partySize;
     18    private String status;
     19    private String specialRequests;
     20    private String paymentStatus;
     21
     22    public ReservationDTO() {
     23    }
     24
     25    public ReservationDTO(Long reservationID, String userEmail, BigDecimal rating, Long tableNumber, LocalDateTime reservationDateTime, LocalDateTime checkInTime, Restaurant restaurant, int partySize, String status, String specialRequests, String paymentStatus) {
     26        this.reservationID = reservationID;
     27        this.userEmail = userEmail;
     28        this.rating = rating;
     29        this.tableNumber = tableNumber;
     30        this.reservationDateTime = reservationDateTime;
     31        this.checkInTime = checkInTime;
     32        this.restaurant = restaurant;
     33        this.partySize = partySize;
     34        this.status = status;
     35        this.specialRequests = specialRequests;
     36        this.paymentStatus = paymentStatus;
     37    }
     38
     39    public ReservationDTO(Reservation reservation) {
     40        this.reservationID = reservation.getReservationID();
     41        this.userEmail = reservation.getUser().getEmail();
     42        this.rating = reservation.getRestaurant().getRating();
     43        this.tableNumber = reservation.getTable().getId();
     44        this.reservationDateTime = reservation.getReservationDateTime();
     45        this.checkInTime = reservation.getCheckInTime();
     46        this.restaurant = reservation.getRestaurant();
     47        this.partySize = reservation.getPartySize();
     48        this.status = reservation.getStatus();
     49        this.specialRequests = reservation.getSpecialRequests();
     50        this.paymentStatus = reservation.getPaymentStatus();
     51    }
     52
     53    public Long getReservationID() {
     54        return reservationID;
     55    }
     56
     57    public void setReservationID(Long reservationID) {
     58        this.reservationID = reservationID;
     59    }
     60
     61    public String getUserEmail() {
     62        return userEmail;
     63    }
     64
     65    public void setUserEmail(String userEmail) {
     66        this.userEmail = userEmail;
     67    }
     68
     69    public BigDecimal getRating() {
     70        return rating;
     71    }
     72
     73    public void setRating(BigDecimal rating) {
     74        this.rating = rating;
     75    }
     76
     77    public Long getTableNumber() {
     78        return tableNumber;
     79    }
     80
     81    public void setTableNumber(Long tableNumber) {
     82        this.tableNumber = tableNumber;
     83    }
     84
     85    public LocalDateTime getReservationDateTime() {
     86        return reservationDateTime;
     87    }
     88
     89    public void setReservationDateTime(LocalDateTime reservationDateTime) {
     90        this.reservationDateTime = reservationDateTime;
     91    }
     92
     93    public LocalDateTime getCheckInTime() {
     94        return checkInTime;
     95    }
     96
     97    public void setCheckInTime(LocalDateTime checkInTime) {
     98        this.checkInTime = checkInTime;
     99    }
     100
     101    public Restaurant getRestaurant() {
     102        return restaurant;
     103    }
     104
     105    public void setRestaurant(Restaurant restaurant) {
     106        this.restaurant = restaurant;
     107    }
     108
     109    public int getPartySize() {
     110        return partySize;
     111    }
     112
     113    public void setPartySize(int partySize) {
     114        this.partySize = partySize;
     115    }
     116
     117    public String getStatus() {
     118        return status;
     119    }
     120
     121    public void setStatus(String status) {
     122        this.status = status;
     123    }
     124
     125    public String getSpecialRequests() {
     126        return specialRequests;
     127    }
     128
     129    public void setSpecialRequests(String specialRequests) {
     130        this.specialRequests = specialRequests;
     131    }
     132
     133    public String getPaymentStatus() {
     134        return paymentStatus;
     135    }
     136
     137    public void setPaymentStatus(String paymentStatus) {
     138        this.paymentStatus = paymentStatus;
     139    }
    2140}
Note: See TracChangeset for help on using the changeset viewer.