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

Location:
src/main/java/com/example/rezevirajmasa/demo/dto
Files:
3 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}
  • src/main/java/com/example/rezevirajmasa/demo/dto/RestaurantDTO.java

    rf5b256e rdeea3c4  
    1 package com.example.rezevirajmasa.demo.dto;public class RestaurantDTO {
     1package com.example.rezevirajmasa.demo.dto;
     2
     3import com.example.rezevirajmasa.demo.model.Restaurant;
     4
     5import java.util.List;
     6
     7public class RestaurantDTO {
     8    private Long restaurantId;
     9    private String name;
     10    private String cuisineType;
     11    private String address;
     12    private String phone;
     13    private String operatingHours;
     14    private String website;
     15    private String socialMediaLinks;
     16    private Double rating;
     17    private List<TableDTO> tablesList;
     18
     19    public RestaurantDTO() {
     20    }
     21
     22    public RestaurantDTO(Long restaurantId, String name, String cuisineType, String address, String phone, String operatingHours, String website, String socialMediaLinks, Double rating, List<TableDTO> tablesList) {
     23        this.restaurantId = restaurantId;
     24        this.name = name;
     25        this.cuisineType = cuisineType;
     26        this.address = address;
     27        this.phone = phone;
     28        this.operatingHours = operatingHours;
     29        this.website = website;
     30        this.socialMediaLinks = socialMediaLinks;
     31        this.rating = rating;
     32        this.tablesList = tablesList;
     33    }
     34
     35//    public RestaurantDTO(Restaurant restaurant) {
     36//        this.restaurantId = restaurant.getRestaurantId();
     37//        this.name = restaurant.getName();
     38//        this.cuisineType = restaurant.getCuisineType();
     39//        this.address = restaurant.getAddress();
     40//        this.phone = restaurant.getPhone();
     41//        this.operatingHours = restaurant.getOperatingHours();
     42//        this.website = restaurant.getWebsite();
     43//        this.socialMediaLinks = restaurant.getSocialMediaLinks();
     44//        this.rating = restaurant.getRating().doubleValue();
     45//        this.tablesList = restaurant.getTablesList();
     46//    }
     47
     48    public Long getRestaurantId() {
     49        return restaurantId;
     50    }
     51
     52    public void setRestaurantId(Long restaurantId) {
     53        this.restaurantId = restaurantId;
     54    }
     55
     56    public String getName() {
     57        return name;
     58    }
     59
     60    public void setName(String name) {
     61        this.name = name;
     62    }
     63
     64    public String getCuisineType() {
     65        return cuisineType;
     66    }
     67
     68    public void setCuisineType(String cuisineType) {
     69        this.cuisineType = cuisineType;
     70    }
     71
     72    public String getAddress() {
     73        return address;
     74    }
     75
     76    public void setAddress(String address) {
     77        this.address = address;
     78    }
     79
     80    public String getPhone() {
     81        return phone;
     82    }
     83
     84    public void setPhone(String phone) {
     85        this.phone = phone;
     86    }
     87
     88    public String getOperatingHours() {
     89        return operatingHours;
     90    }
     91
     92    public void setOperatingHours(String operatingHours) {
     93        this.operatingHours = operatingHours;
     94    }
     95
     96    public String getWebsite() {
     97        return website;
     98    }
     99
     100    public void setWebsite(String website) {
     101        this.website = website;
     102    }
     103
     104    public String getSocialMediaLinks() {
     105        return socialMediaLinks;
     106    }
     107
     108    public void setSocialMediaLinks(String socialMediaLinks) {
     109        this.socialMediaLinks = socialMediaLinks;
     110    }
     111
     112    public Double getRating() {
     113        return rating;
     114    }
     115
     116    public void setRating(Double rating) {
     117        this.rating = rating;
     118    }
     119
     120    public List<TableDTO> getTablesList() {
     121        return tablesList;
     122    }
     123
     124    public void setTablesList(List<TableDTO> tablesList) {
     125        this.tablesList = tablesList;
     126    }
    2127}
  • src/main/java/com/example/rezevirajmasa/demo/dto/TableDTO.java

    rf5b256e rdeea3c4  
    1 package com.example.rezevirajmasa.demo.dto;public class TableDTO {
     1package com.example.rezevirajmasa.demo.dto;
     2
     3import lombok.NoArgsConstructor;
     4
     5import java.util.List;
     6
     7@NoArgsConstructor
     8    public class TableDTO {
     9        private Long id;
     10        private Integer capacity;
     11        private String location;
     12        private String description;
     13        private Integer reservationDurationHours;
     14        private List<ReservationDTO> reservations;
     15
     16    public TableDTO(Long id, Integer capacity, String location, String description, Integer reservationDurationHours, List<ReservationDTO> reservations) {
     17        this.id = id;
     18        this.capacity = capacity;
     19        this.location = location;
     20        this.description = description;
     21        this.reservationDurationHours = reservationDurationHours;
     22        this.reservations = reservations;
     23    }
     24
     25    // Getters and setters
     26    public Long getId() {
     27        return id;
     28    }
     29
     30    public void setId(Long id) {
     31        this.id = id;
     32    }
     33
     34    public Integer getCapacity() {
     35        return capacity;
     36    }
     37
     38    public void setCapacity(Integer capacity) {
     39        this.capacity = capacity;
     40    }
     41
     42    public String getLocation() {
     43        return location;
     44    }
     45
     46    public void setLocation(String location) {
     47        this.location = location;
     48    }
     49
     50    public String getDescription() {
     51        return description;
     52    }
     53
     54    public void setDescription(String description) {
     55        this.description = description;
     56    }
     57
     58    public Integer getReservationDurationHours() {
     59        return reservationDurationHours;
     60    }
     61
     62    public void setReservationDurationHours(Integer reservationDurationHours) {
     63        this.reservationDurationHours = reservationDurationHours;
     64    }
     65
     66    public List<ReservationDTO> getReservations() {
     67        return reservations;
     68    }
     69
     70    public void setReservations(List<ReservationDTO> reservations) {
     71        this.reservations = reservations;
     72    }
    273}
     74
Note: See TracChangeset for help on using the changeset viewer.