Ignore:
Timestamp:
12/26/23 18:50:43 (10 months ago)
Author:
gjoko kostadinov <gjokokostadinov@…>
Branches:
master
Children:
1413ee2
Parents:
950fa0d
Message:

Add entire code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/entity/Appointment.java

    • Property mode changed from 100644 to 100755
    r950fa0d r77205be  
    11package edu.gjoko.schedlr.entity;
    22
    3 import lombok.AllArgsConstructor;
    4 import lombok.Getter;
    5 import lombok.NoArgsConstructor;
    6 import lombok.Setter;
     3import com.fasterxml.jackson.annotation.JsonBackReference;
     4import lombok.*;
    75import org.springframework.data.annotation.LastModifiedDate;
    86import org.springframework.data.jpa.domain.support.AuditingEntityListener;
     
    1412@EntityListeners(AuditingEntityListener.class)
    1513@Table(name = "appointment")
    16 @Getter
    17 @Setter
     14@Data
    1815@NoArgsConstructor
    1916@AllArgsConstructor
     
    3027    private LocalDateTime endTime;
    3128
    32     @OneToOne
    33     @JoinColumn(name = "customer_id", referencedColumnName = "id")
     29    @ManyToOne
     30    @JoinColumn(name = "stakeholder_id")
     31    @JsonBackReference(value = "customerAppointments")
    3432    private Stakeholder customer;
    3533
    3634    @ManyToOne
    37     @JoinColumn(name = "business_id")
    38     private Business business;
     35    @JoinColumn(name = "service_id")
     36    @JsonBackReference(value = "serviceAppointments")
     37    private Service service;
    3938
    40     @ManyToOne
    41     @JoinColumn(name = "service_id")
    42     private Service service;
     39    @Column(name = "appointment_status", length = 32, columnDefinition = "varchar(32) default 'NEW'")
     40    @Enumerated(EnumType.STRING)
     41    private AppointmentStatus appointmentStatus = AppointmentStatus.NEW;
    4342
    4443    @Column(name = "created")
     
    4948    @LastModifiedDate
    5049    private LocalDateTime modified;
     50
     51    public String getTimePeriod() {
     52        return startTime + " - " + endTime;
     53    }
     54
    5155}
Note: See TracChangeset for help on using the changeset viewer.