Ignore:
Timestamp:
04/30/25 18:24:41 (2 weeks ago)
Author:
Aleksandar Panovski <apano77@…>
Branches:
main
Children:
2518b3a
Parents:
deea3c4
Message:

menu feature done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/rezevirajmasa/demo/model/Reservation.java

    rdeea3c4 re15e8d9  
    44import com.fasterxml.jackson.annotation.JsonManagedReference;
    55import jakarta.persistence.*;
     6import lombok.Data;
     7import lombok.Getter;
     8import lombok.Setter;
    69
    710import java.math.BigDecimal;
    811import java.time.LocalDateTime;
    912import java.time.LocalTime;
     13import java.util.ArrayList;
     14import java.util.List;
    1015
    1116@Entity
    1217@Table(name = "reservations")
     18@Data
    1319public class Reservation {
    1420
     
    4753    private LocalDateTime checkInTime;
    4854
     55    @Getter
    4956    @Column(name = "CheckOutTime")
    5057    private LocalDateTime checkOutTime;
    5158
    52 //    @Column(name = "TotalAmount", precision = 8, scale = 2)
    53 //    private BigDecimal totalAmount;
     59    @ElementCollection
     60    @CollectionTable(name = "reservation_preordered_items", joinColumns = @JoinColumn(name = "reservation_id"))
     61    @Column(name = "item")
     62    private List<String> preOrderedItems = new ArrayList<>();
    5463
    5564    @Column(name = "PaymentStatus", length = 20, nullable = false, columnDefinition = "VARCHAR default 'Unpaid'")
     
    7180
    7281    public Reservation(User user, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, LocalDateTime checkInTime, LocalDateTime checkOutTime, String paymentStatus) {
    73 //        this.customer = customer;
    7482        this.table = table;
    7583        this.user = user;
     
    8492    }
    8593
    86     public User getUser() {
    87         return user;
    88     }
    89 
    90     public void setUser(User user) {
    91         this.user = user;
    92     }
    93 
    94     public Long getReservationID() {
    95         return reservationID;
    96     }
    97 
    98     public void setReservationID(Long reservationID) {
    99         this.reservationID = reservationID;
    100     }
    101 
    102 
    103     public TableEntity getTable() {
    104         return table;
    105     }
    106 
    107     public void setTable(TableEntity table) {
    108         this.table = table;
    109     }
    110 
    111     public Restaurant getRestaurant() {
    112         return restaurant;
    113     }
    114 
    115     public void setRestaurant(Restaurant restaurant) {
    116         this.restaurant = restaurant;
    117     }
    118 
    119     public LocalDateTime getReservationDateTime() {
    120         return reservationDateTime;
    121     }
    122 
    123     public void setReservationDateTime(LocalDateTime reservationDateTime) {
    124         this.reservationDateTime = reservationDateTime;
    125     }
    126 
    127     public int getPartySize() {
    128         return partySize;
    129     }
    130 
    131     public void setPartySize(int partySize) {
    132         this.partySize = partySize;
    133     }
    134 
    135     public String getSpecialRequests() {
    136         return specialRequests;
    137     }
    138 
    139     public void setSpecialRequests(String specialRequests) {
    140         this.specialRequests = specialRequests;
    141     }
    142 
    143     public String getStatus() {
    144         return status;
    145     }
    146 
    147     public void setStatus(String status) {
    148         this.status = status;
    149     }
    150 
    151     public LocalDateTime getCheckInTime() {
    152         return checkInTime;
    153     }
    154 
    155     public void setCheckInTime(LocalDateTime checkInTime) {
    156         this.checkInTime = checkInTime;
    157     }
    158 
    159     public LocalDateTime getCheckOutTime() {
    160         return checkOutTime;
    161     }
    162 
    163     public void setCheckOutTime(LocalDateTime checkOutTime) {
    164         this.checkOutTime = checkOutTime;
    165     }
    166 
    167     public String getPaymentStatus() {
    168         return paymentStatus;
    169     }
    170 
    171     public void setPaymentStatus(String paymentStatus) {
    172         this.paymentStatus = paymentStatus;
    173     }
    17494
    17595    @Override
Note: See TracChangeset for help on using the changeset viewer.