Ignore:
Timestamp:
01/19/25 23:18:37 (4 months ago)
Author:
Aleksandar Panovski <apano77@…>
Branches:
main
Children:
f5b256e
Parents:
db39d9e
Message:

Done with stupid timeslots

Location:
src/main/java/com/example/rezevirajmasa/demo/model
Files:
3 edited

Legend:

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

    rdb39d9e r8ca35dc  
    1616
    1717    @ManyToOne
    18     @JoinColumn(name = "CustomerID")
    19     private Customer customer;
     18    @JoinColumn(name = "UserID")
     19    private User user;
    2020
    2121    @ManyToOne
     
    6868    }
    6969
    70     public Reservation(Customer customer, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, LocalDateTime checkInTime, LocalDateTime checkOutTime, String paymentStatus) {
     70    public Reservation(User user, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, LocalDateTime checkInTime, LocalDateTime checkOutTime, String paymentStatus) {
    7171//        this.customer = customer;
    7272        this.table = table;
     73        this.user = user;
    7374        this.restaurant = restaurant;
    7475        this.reservationDateTime = reservationDateTime;
     
    8182    }
    8283
     84    public User getUser() {
     85        return user;
     86    }
     87
     88    public void setUser(User user) {
     89        this.user = user;
     90    }
     91
    8392    public Long getReservationID() {
    8493        return reservationID;
     
    8998    }
    9099
    91     public Customer getCustomer() {
    92         return customer;
    93     }
    94 
    95     public void setCustomer(Customer customer) {
    96         this.customer = customer;
    97     }
    98100
    99101    public TableEntity getTable() {
     
    173175        return "Reservation{" +
    174176                "reservationID=" + reservationID +
    175                 ", customer=" + customer +
     177                ", customer=" + user +
    176178                ", table=" + table +
    177179                ", restaurant=" + restaurant +
  • src/main/java/com/example/rezevirajmasa/demo/model/Restaurant.java

    rdb39d9e r8ca35dc  
    151151        @ManyToOne
    152152        @JoinColumn(name = "customer_id")
    153         private Customer customer;
     153        private User user;
    154154
    155155        @ManyToOne
     
    179179        private LocalDateTime checkInDate;
    180180
    181         public ReservationHistory(Customer customer, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, String cancellationReason, LocalDateTime checkInDate) {
    182             this.customer = customer;
     181        public ReservationHistory(User user, TableEntity table, Restaurant restaurant, LocalDateTime reservationDateTime, int partySize, String specialRequests, String status, String cancellationReason, LocalDateTime checkInDate) {
     182            this.user = user;
    183183            this.table = table;
    184184            this.restaurant = restaurant;
     
    202202        }
    203203
    204         public Customer getCustomer() {
    205             return customer;
    206         }
    207 
    208         public void setCustomer(Customer customer) {
    209             this.customer = customer;
     204        public User getUser() {
     205            return user;
     206        }
     207
     208        public void setUser(User user) {
     209            this.user = user;
    210210        }
    211211
     
    278278            return "ReservationHistory{" +
    279279                    "id=" + id +
    280                     ", customer=" + customer +
     280                    ", user=" + user +
    281281                    ", table=" + table +
    282282                    ", restaurant=" + restaurant +
  • src/main/java/com/example/rezevirajmasa/demo/model/User.java

    rdb39d9e r8ca35dc  
    77import lombok.NoArgsConstructor;
    88import org.springframework.web.bind.annotation.GetMapping;
     9
     10import java.util.Date;
    911
    1012@AllArgsConstructor
     
    3133    @Column(nullable = false)
    3234    private String password;
     35
     36    @Enumerated(EnumType.STRING)
     37    private Role role;
     38
     39    @Column(name = "Phone", length = 20)
     40    private String phone;
     41
     42    @Column(name = "Address", columnDefinition = "TEXT")
     43    private String address;
     44
     45    @Enumerated(EnumType.STRING)
     46    @Column(name = "MembershipLevel", length = 20)
     47    private MembershipLevel membershipLevel;
     48
     49    @Column(name = "RegistrationDate", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
     50    @Temporal(TemporalType.TIMESTAMP)
     51    private Date registrationDate;
    3352}
Note: See TracChangeset for help on using the changeset viewer.